Class: Aerospike::ListValue
Overview
List value. Supported by Aerospike 3 servers only.
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
#initialize(list) ⇒ ListValue
:nodoc:
385 386 387 |
# File 'lib/aerospike/value/value.rb', line 385 def initialize(list) @list = list || [] end |
Instance Method Details
#estimate_size ⇒ Object
389 390 391 |
# File 'lib/aerospike/value/value.rb', line 389 def estimate_size bytes.bytesize end |
#get ⇒ Object
409 410 411 |
# File 'lib/aerospike/value/value.rb', line 409 def get @list end |
#pack(packer) ⇒ Object
398 399 400 401 402 403 |
# File 'lib/aerospike/value/value.rb', line 398 def pack(packer) packer.write_array_header(@list.length) for val in @list Value.of(val).pack(packer) end end |
#to_bytes ⇒ Object
413 414 415 |
# File 'lib/aerospike/value/value.rb', line 413 def to_bytes bytes end |
#to_s ⇒ Object
417 418 419 |
# File 'lib/aerospike/value/value.rb', line 417 def to_s @list.map{|v| v.to_s}.to_s end |
#type ⇒ Object
405 406 407 |
# File 'lib/aerospike/value/value.rb', line 405 def type Aerospike::ParticleType::LIST end |
#write(buffer, offset) ⇒ Object
393 394 395 396 |
# File 'lib/aerospike/value/value.rb', line 393 def write(buffer, offset) buffer.write_binary(bytes, offset) bytes.bytesize end |