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:
233 234 235 236 |
# File 'lib/aerospike/value/value.rb', line 233 def initialize(val) @value = val || 0.0 self end |
Instance Method Details
#estimate_size ⇒ Object
238 239 240 |
# File 'lib/aerospike/value/value.rb', line 238 def estimate_size 8 end |
#get ⇒ Object
255 256 257 |
# File 'lib/aerospike/value/value.rb', line 255 def get @value end |
#pack(packer) ⇒ Object
247 248 249 |
# File 'lib/aerospike/value/value.rb', line 247 def pack(packer) packer.write(@value) end |
#to_bytes ⇒ Object
259 260 261 |
# File 'lib/aerospike/value/value.rb', line 259 def to_bytes [@value].pack('G') end |
#to_s ⇒ Object
263 264 265 |
# File 'lib/aerospike/value/value.rb', line 263 def to_s @value.to_s end |
#type ⇒ Object
251 252 253 |
# File 'lib/aerospike/value/value.rb', line 251 def type Aerospike::ParticleType::DOUBLE end |
#write(buffer, offset) ⇒ Object
242 243 244 245 |
# File 'lib/aerospike/value/value.rb', line 242 def write(buffer, offset) buffer.write_double(@value, offset) 8 end |