Class: Cloudflare::KV::Namespace

Inherits:
Representation
  • Object
show all
Defined in:
lib/cloudflare/kv/namespaces.rb

Instance Method Summary collapse

Methods inherited from Representation

#process_response, #represent, #represent_message, #representation, #to_hash

Instance Method Details

#delete_value(name) ⇒ Object



27
28
29
# File 'lib/cloudflare/kv/namespaces.rb', line 27

def delete_value(name)
	value_representation(name).delete.success?
end

#idObject



31
32
33
# File 'lib/cloudflare/kv/namespaces.rb', line 31

def id
	value[:id]
end

#keysObject



35
36
37
# File 'lib/cloudflare/kv/namespaces.rb', line 35

def keys
	self.with(Keys, path: 'keys')
end

#read_value(name) ⇒ Object



39
40
41
# File 'lib/cloudflare/kv/namespaces.rb', line 39

def read_value(name)
	value_representation(name).value
end

#rename(new_title) ⇒ Object



43
44
45
46
# File 'lib/cloudflare/kv/namespaces.rb', line 43

def rename(new_title)
	put(title: new_title)
	value[:title] = new_title
end

#titleObject



48
49
50
# File 'lib/cloudflare/kv/namespaces.rb', line 48

def title
	value[:title]
end

#write_value(name, value) ⇒ Object



52
53
54
# File 'lib/cloudflare/kv/namespaces.rb', line 52

def write_value(name, value)
	value_representation(name).put(value).success?
end