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:
667 668 669 670 |
# File 'lib/aerospike/value/value.rb', line 667 def initialize(val) @value = val || false self end |
Instance Method Details
#estimate_size ⇒ Object
672 673 674 |
# File 'lib/aerospike/value/value.rb', line 672 def estimate_size 1 end |
#get ⇒ Object
690 691 692 |
# File 'lib/aerospike/value/value.rb', line 690 def get @value end |
#pack(packer) ⇒ Object
682 683 684 |
# File 'lib/aerospike/value/value.rb', line 682 def pack(packer) packer.write(@value) end |
#to_bytes ⇒ Object
694 695 696 |
# File 'lib/aerospike/value/value.rb', line 694 def to_bytes @value.ord end |
#to_s ⇒ Object
698 699 700 |
# File 'lib/aerospike/value/value.rb', line 698 def to_s @value.to_s end |
#type ⇒ Object
686 687 688 |
# File 'lib/aerospike/value/value.rb', line 686 def type Aerospike::ParticleType::BOOL end |
#write(buffer, offset) ⇒ Object
676 677 678 679 680 |
# File 'lib/aerospike/value/value.rb', line 676 def write(buffer, offset) val = @value ? 1 : 0 buffer.write_byte(val.ord, offset) 1 end |