Class: LibSL::LLBool
- Inherits:
-
Object
- Object
- LibSL::LLBool
- Defined in:
- lib/types.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #==(val) ⇒ Object
- #encode ⇒ Object
- #eql?(val) ⇒ Boolean
-
#initialize(value) ⇒ LLBool
constructor
A new instance of LLBool.
Constructor Details
#initialize(value) ⇒ LLBool
Returns a new instance of LLBool.
449 450 451 |
# File 'lib/types.rb', line 449 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
448 449 450 |
# File 'lib/types.rb', line 448 def value @value end |
Class Method Details
.decode(data) ⇒ Object
431 432 433 434 |
# File 'lib/types.rb', line 431 def self.decode(data) data = data.unpack('C1a*') return self.new(data[0] == 1), data[1] end |
Instance Method Details
#==(val) ⇒ Object
444 445 446 |
# File 'lib/types.rb', line 444 def ==(val) @value == val end |
#encode ⇒ Object
436 437 438 |
# File 'lib/types.rb', line 436 def encode() [@value ? 1 : 0].pack('C') end |
#eql?(val) ⇒ Boolean
440 441 442 |
# File 'lib/types.rb', line 440 def eql?(val) @value == val end |