Class: Imperium::KVPair
Overview
KVPair provides a more OO/Rubyish interface to the objects returned from the KV API on a GET request.
Instance Attribute Summary collapse
-
#create_index ⇒ Integer
The internal index value representing when the entry was created.
-
#flags ⇒ Integer
An opaque unsigned integer for use by the client application.
-
#key ⇒ String
The full path for the entry.
-
#lock_index ⇒ Integer
The number of times this key has successfully been locked, the #session attribute indicates which session owns the lock.
-
#modify_index ⇒ Integer
The internal index value representing when the entry was last updated.
-
#session ⇒ String
The identifier for the session that owns the lock.
-
#value ⇒ String
The stored value (returned already base64 decoded).
Method Summary
Methods inherited from APIObject
#==, #attribute_map, #initialize, #ruby_attribute_names, #to_h
Constructor Details
This class inherits a constructor from Imperium::APIObject
Instance Attribute Details
#create_index ⇒ Integer
Returns The internal index value representing when the entry was created.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/imperium/kv_pair.rb', line 28 class KVPair < APIObject self.attribute_map = { 'LockIndex' => :lock_index, 'Session' => :session, 'Key' => :key, 'Flags' => :flags, 'Value' => :value, 'CreateIndex' => :create_index, 'ModifyIndex' => :modify_index, }.freeze # Capture and base64 decode a value from the api. # # @param value [String] The base64 encoded value from the response. def value=(value) return @value = nil if value.nil? @value = Base64.decode64 value end end |
#flags ⇒ Integer
Returns An opaque unsigned integer for use by the client application.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/imperium/kv_pair.rb', line 28 class KVPair < APIObject self.attribute_map = { 'LockIndex' => :lock_index, 'Session' => :session, 'Key' => :key, 'Flags' => :flags, 'Value' => :value, 'CreateIndex' => :create_index, 'ModifyIndex' => :modify_index, }.freeze # Capture and base64 decode a value from the api. # # @param value [String] The base64 encoded value from the response. def value=(value) return @value = nil if value.nil? @value = Base64.decode64 value end end |
#key ⇒ String
Returns The full path for the entry.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/imperium/kv_pair.rb', line 28 class KVPair < APIObject self.attribute_map = { 'LockIndex' => :lock_index, 'Session' => :session, 'Key' => :key, 'Flags' => :flags, 'Value' => :value, 'CreateIndex' => :create_index, 'ModifyIndex' => :modify_index, }.freeze # Capture and base64 decode a value from the api. # # @param value [String] The base64 encoded value from the response. def value=(value) return @value = nil if value.nil? @value = Base64.decode64 value end end |
#lock_index ⇒ Integer
Returns The number of times this key has successfully been locked, the #session attribute indicates which session owns the lock.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/imperium/kv_pair.rb', line 28 class KVPair < APIObject self.attribute_map = { 'LockIndex' => :lock_index, 'Session' => :session, 'Key' => :key, 'Flags' => :flags, 'Value' => :value, 'CreateIndex' => :create_index, 'ModifyIndex' => :modify_index, }.freeze # Capture and base64 decode a value from the api. # # @param value [String] The base64 encoded value from the response. def value=(value) return @value = nil if value.nil? @value = Base64.decode64 value end end |
#modify_index ⇒ Integer
Returns The internal index value representing when the entry was last updated.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/imperium/kv_pair.rb', line 28 class KVPair < APIObject self.attribute_map = { 'LockIndex' => :lock_index, 'Session' => :session, 'Key' => :key, 'Flags' => :flags, 'Value' => :value, 'CreateIndex' => :create_index, 'ModifyIndex' => :modify_index, }.freeze # Capture and base64 decode a value from the api. # # @param value [String] The base64 encoded value from the response. def value=(value) return @value = nil if value.nil? @value = Base64.decode64 value end end |
#session ⇒ String
Returns The identifier for the session that owns the lock.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/imperium/kv_pair.rb', line 28 class KVPair < APIObject self.attribute_map = { 'LockIndex' => :lock_index, 'Session' => :session, 'Key' => :key, 'Flags' => :flags, 'Value' => :value, 'CreateIndex' => :create_index, 'ModifyIndex' => :modify_index, }.freeze # Capture and base64 decode a value from the api. # # @param value [String] The base64 encoded value from the response. def value=(value) return @value = nil if value.nil? @value = Base64.decode64 value end end |
#value ⇒ String
Returns The stored value (returned already base64 decoded).
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/imperium/kv_pair.rb', line 28 class KVPair < APIObject self.attribute_map = { 'LockIndex' => :lock_index, 'Session' => :session, 'Key' => :key, 'Flags' => :flags, 'Value' => :value, 'CreateIndex' => :create_index, 'ModifyIndex' => :modify_index, }.freeze # Capture and base64 decode a value from the api. # # @param value [String] The base64 encoded value from the response. def value=(value) return @value = nil if value.nil? @value = Base64.decode64 value end end |