class Cloudflare::KV::Namespaces

Public Instance Methods

create(title, **options) click to toggle source
# File lib/cloudflare/kv/namespaces.rb, line 93
def create(title, **options)
        payload = {title: title, **options}
        
        Namespace.post(@resource, payload) do |resource, response|
                value = response.read
                result = value[:result]
                metadata = response.headers
                
                if id = result[:id]
                        resource = resource.with(path: id)
                end
                
                Namespace.new(resource, value: value, metadata: metadata)
        end
end
find_by_title(title) click to toggle source
# File lib/cloudflare/kv/namespaces.rb, line 109
def find_by_title(title)
        each.find {|namespace| namespace.title == title }
end
representation() click to toggle source
# File lib/cloudflare/kv/namespaces.rb, line 89
def representation
        Namespace
end