Class: LibSL::LLBool

Inherits:
Object
  • Object
show all
Defined in:
lib/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#valueObject

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

#encodeObject



436
437
438
# File 'lib/types.rb', line 436

def encode()
	[@value ? 1 : 0].pack('C')
end

#eql?(val) ⇒ Boolean

Returns:

  • (Boolean)


440
441
442
# File 'lib/types.rb', line 440

def eql?(val)
	@value == val
end