Class: Aerospike::BoolValue
Overview
Boolean value. Supported by Aerospike server 5.6+ only.
Instance Method Summary collapse
- #estimate_size ⇒ Object
- #get ⇒ Object
-
#initialize(val) ⇒ BoolValue
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) ⇒ BoolValue
:nodoc:
638 639 640 641 |
# File 'lib/aerospike/value/value.rb', line 638 def initialize(val) @value = val || false self end |
Instance Method Details
#estimate_size ⇒ Object
643 644 645 |
# File 'lib/aerospike/value/value.rb', line 643 def estimate_size 1 end |
#get ⇒ Object
661 662 663 |
# File 'lib/aerospike/value/value.rb', line 661 def get @value end |
#pack(packer) ⇒ Object
653 654 655 |
# File 'lib/aerospike/value/value.rb', line 653 def pack(packer) packer.write(@value) end |
#to_bytes ⇒ Object
665 666 667 |
# File 'lib/aerospike/value/value.rb', line 665 def to_bytes @value.ord end |
#to_s ⇒ Object
669 670 671 |
# File 'lib/aerospike/value/value.rb', line 669 def to_s @value.to_s end |
#type ⇒ Object
657 658 659 |
# File 'lib/aerospike/value/value.rb', line 657 def type Aerospike::ParticleType::BOOL end |
#write(buffer, offset) ⇒ Object
647 648 649 650 651 |
# File 'lib/aerospike/value/value.rb', line 647 def write(buffer, offset) val = @value ? 1 : 0 buffer.write_byte(val.ord, offset) 1 end |