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:
331 332 333 334 |
# File 'lib/aerospike/value/value.rb', line 331 def initialize(val) @value = val || 0.0 self end |
Instance Method Details
#estimate_size ⇒ Object
336 337 338 |
# File 'lib/aerospike/value/value.rb', line 336 def estimate_size 8 end |
#get ⇒ Object
353 354 355 |
# File 'lib/aerospike/value/value.rb', line 353 def get @value end |
#pack(packer) ⇒ Object
345 346 347 |
# File 'lib/aerospike/value/value.rb', line 345 def pack(packer) packer.write(@value) end |
#to_bytes ⇒ Object
357 358 359 |
# File 'lib/aerospike/value/value.rb', line 357 def to_bytes [@value].pack('G') end |
#to_s ⇒ Object
361 362 363 |
# File 'lib/aerospike/value/value.rb', line 361 def to_s @value.to_s end |
#type ⇒ Object
349 350 351 |
# File 'lib/aerospike/value/value.rb', line 349 def type Aerospike::ParticleType::DOUBLE end |
#write(buffer, offset) ⇒ Object
340 341 342 343 |
# File 'lib/aerospike/value/value.rb', line 340 def write(buffer, offset) buffer.write_double(@value, offset) 8 end |