Class: Aerospike::FloatValue
- Defined in:
- lib/aerospike/value/value.rb
Overview
Float value.
Constant Summary
Constants inherited from 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:
316 317 318 319 |
# File 'lib/aerospike/value/value.rb', line 316 def initialize(val) @value = val || 0.0 self end |
Instance Method Details
#estimate_size ⇒ Object
321 322 323 |
# File 'lib/aerospike/value/value.rb', line 321 def estimate_size 8 end |
#get ⇒ Object
338 339 340 |
# File 'lib/aerospike/value/value.rb', line 338 def get @value end |
#pack(packer) ⇒ Object
330 331 332 |
# File 'lib/aerospike/value/value.rb', line 330 def pack(packer) packer.write(@value) end |
#to_bytes ⇒ Object
342 343 344 |
# File 'lib/aerospike/value/value.rb', line 342 def to_bytes [@value].pack('G') end |
#to_s ⇒ Object
346 347 348 |
# File 'lib/aerospike/value/value.rb', line 346 def to_s @value.to_s end |
#type ⇒ Object
334 335 336 |
# File 'lib/aerospike/value/value.rb', line 334 def type Aerospike::ParticleType::DOUBLE end |
#write(buffer, offset) ⇒ Object
325 326 327 328 |
# File 'lib/aerospike/value/value.rb', line 325 def write(buffer, offset) buffer.write_double(@value, offset) 8 end |