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