lib/cloudflare/accounts.rb in cloudflare-4.0.1 vs lib/cloudflare/accounts.rb in cloudflare-4.1.0
- old
+ new
@@ -22,30 +22,26 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
require_relative 'representation'
require_relative 'paginate'
+require_relative 'kv/namespaces'
module Cloudflare
class Account < Representation
+ def id
+ value[:id]
+ end
+
+ def kv_namespaces
+ KV::Namespaces.new(@resource.with(path: 'storage/kv/namespaces'))
+ end
end
-
+
class Accounts < Representation
include Paginate
-
- def represent(metadata, attributes)
- resource = @resource.with(path: attributes[:id])
-
- return Account.new(resource, metadata: metadata, value: attributes)
- end
-
- def create(name)
- response = self.post(name: name)
-
- return represent(response.headers, response.read)
- end
-
- def find_by_id(id)
- Zone.new(@resource.with(path: id))
+
+ def representation
+ Account
end
end
end