Class: Aerospike::IntegerValue
- Defined in:
- lib/aerospike/value/value.rb
Overview
Integer value.
Constant Summary
Constants inherited from Value
Instance Method Summary collapse
- #estimate_size ⇒ Object
- #get ⇒ Object
-
#initialize(val) ⇒ IntegerValue
constructor
:nodoc:.
- #pack(packer) ⇒ Object
- #to_bytes ⇒ Object
- #to_s ⇒ Object
- #type ⇒ Object
- #write(buffer, offset) ⇒ Object
Methods inherited from Value
Constructor Details
#initialize(val) ⇒ IntegerValue
:nodoc:
273 274 275 276 |
# File 'lib/aerospike/value/value.rb', line 273 def initialize(val) @value = val || 0 self end |
Instance Method Details
#estimate_size ⇒ Object
278 279 280 |
# File 'lib/aerospike/value/value.rb', line 278 def estimate_size 8 end |
#get ⇒ Object
295 296 297 |
# File 'lib/aerospike/value/value.rb', line 295 def get @value end |
#pack(packer) ⇒ Object
287 288 289 |
# File 'lib/aerospike/value/value.rb', line 287 def pack(packer) packer.write(@value) end |
#to_bytes ⇒ Object
299 300 301 302 303 |
# File 'lib/aerospike/value/value.rb', line 299 def to_bytes # Convert integer to big endian unsigned 64 bits. # @see http://ruby-doc.org/core-2.3.0/Array.html#method-i-pack [@value].pack('Q>') end |
#to_s ⇒ Object
305 306 307 |
# File 'lib/aerospike/value/value.rb', line 305 def to_s @value.to_s end |
#type ⇒ Object
291 292 293 |
# File 'lib/aerospike/value/value.rb', line 291 def type Aerospike::ParticleType::INTEGER end |
#write(buffer, offset) ⇒ Object
282 283 284 285 |
# File 'lib/aerospike/value/value.rb', line 282 def write(buffer, offset) buffer.write_int64(@value, offset) 8 end |