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



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

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

#idObject



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

def id
	value[:id]
end

#keysObject



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

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

#read_value(name) ⇒ Object



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

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

#rename(new_title) ⇒ Object



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

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

#titleObject



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

def title
	value[:title]
end

#write_value(name, value) ⇒ Object



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

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