Class: Aerospike::ListValue
Overview
List value. Supported by Aerospike 3 servers only.
Constant Summary
Constants inherited from Value
Instance Method Summary collapse
- #estimate_size ⇒ Object
- #get ⇒ Object
-
#initialize(list) ⇒ ListValue
constructor
:nodoc:.
- #pack(packer) ⇒ Object
- #to_bytes ⇒ Object
- #to_s ⇒ Object
- #type ⇒ Object
- #write(buffer, offset) ⇒ Object
Methods inherited from Value
Constructor Details
Instance Method Details
#estimate_size ⇒ Object
367 368 369 |
# File 'lib/aerospike/value/value.rb', line 367 def estimate_size @bytes.bytesize end |
#get ⇒ Object
387 388 389 |
# File 'lib/aerospike/value/value.rb', line 387 def get @list end |
#pack(packer) ⇒ Object
376 377 378 379 380 381 |
# File 'lib/aerospike/value/value.rb', line 376 def pack(packer) packer.write_array_header(@list.length) for val in @list Value.of(val).pack(packer) end end |
#to_bytes ⇒ Object
391 392 393 |
# File 'lib/aerospike/value/value.rb', line 391 def to_bytes @bytes end |
#to_s ⇒ Object
395 396 397 |
# File 'lib/aerospike/value/value.rb', line 395 def to_s @list.map{|v| v.to_s}.to_s end |
#type ⇒ Object
383 384 385 |
# File 'lib/aerospike/value/value.rb', line 383 def type Aerospike::ParticleType::LIST end |
#write(buffer, offset) ⇒ Object
371 372 373 374 |
# File 'lib/aerospike/value/value.rb', line 371 def write(buffer, offset) buffer.write_binary(@bytes, offset) @bytes.bytesize end |