Class: Code::Object::Boolean

Inherits:
Code::Object show all
Defined in:
lib/code/object/boolean.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Code::Object

#fetch

Constructor Details

#initialize(raw) ⇒ Boolean

Returns a new instance of Boolean.



6
7
8
# File 'lib/code/object/boolean.rb', line 6

def initialize(raw)
  @raw = raw
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



4
5
6
# File 'lib/code/object/boolean.rb', line 4

def raw
  @raw
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



18
19
20
# File 'lib/code/object/boolean.rb', line 18

def ==(other)
  raw == other.raw
end

#hashObject



23
24
25
# File 'lib/code/object/boolean.rb', line 23

def hash
  [self.class, raw].hash
end

#inspectObject



14
15
16
# File 'lib/code/object/boolean.rb', line 14

def inspect
  to_s
end

#to_sObject



10
11
12
# File 'lib/code/object/boolean.rb', line 10

def to_s
  raw.to_s
end