Class: Aerospike::FloatValue
- Defined in:
- lib/aerospike/value/value.rb
Overview
Float value.
Instance Method Summary collapse
- #estimate_size ⇒ Object
- #get ⇒ Object
-
#initialize(val) ⇒ FloatValue
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) ⇒ FloatValue
:nodoc:
343 344 345 346 |
# File 'lib/aerospike/value/value.rb', line 343 def initialize(val) @value = val || 0.0 self end |
Instance Method Details
#estimate_size ⇒ Object
348 349 350 |
# File 'lib/aerospike/value/value.rb', line 348 def estimate_size 8 end |
#get ⇒ Object
365 366 367 |
# File 'lib/aerospike/value/value.rb', line 365 def get @value end |
#pack(packer) ⇒ Object
357 358 359 |
# File 'lib/aerospike/value/value.rb', line 357 def pack(packer) packer.write(@value) end |
#to_bytes ⇒ Object
369 370 371 |
# File 'lib/aerospike/value/value.rb', line 369 def to_bytes [@value].pack('G') end |
#to_s ⇒ Object
373 374 375 |
# File 'lib/aerospike/value/value.rb', line 373 def to_s @value.to_s end |
#type ⇒ Object
361 362 363 |
# File 'lib/aerospike/value/value.rb', line 361 def type Aerospike::ParticleType::DOUBLE end |
#write(buffer, offset) ⇒ Object
352 353 354 355 |
# File 'lib/aerospike/value/value.rb', line 352 def write(buffer, offset) buffer.write_double(@value, offset) 8 end |