Class: Aerospike::IntegerValue
- Defined in:
- lib/aerospike/value/value.rb
Overview
Integer 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:
288 289 290 291 |
# File 'lib/aerospike/value/value.rb', line 288 def initialize(val) @value = val || 0 self end |
Instance Method Details
#estimate_size ⇒ Object
293 294 295 |
# File 'lib/aerospike/value/value.rb', line 293 def estimate_size 8 end |
#get ⇒ Object
310 311 312 |
# File 'lib/aerospike/value/value.rb', line 310 def get @value end |
#pack(packer) ⇒ Object
302 303 304 |
# File 'lib/aerospike/value/value.rb', line 302 def pack(packer) packer.write(@value) end |
#to_bytes ⇒ Object
314 315 316 317 318 |
# File 'lib/aerospike/value/value.rb', line 314 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
320 321 322 |
# File 'lib/aerospike/value/value.rb', line 320 def to_s @value.to_s end |
#type ⇒ Object
306 307 308 |
# File 'lib/aerospike/value/value.rb', line 306 def type Aerospike::ParticleType::INTEGER end |
#write(buffer, offset) ⇒ Object
297 298 299 300 |
# File 'lib/aerospike/value/value.rb', line 297 def write(buffer, offset) buffer.write_int64(@value, offset) 8 end |