Class: Code::Object::String

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Code::Object

#fetch

Constructor Details

#initialize(string) ⇒ String

Returns a new instance of String.



8
9
10
# File 'lib/code/object/string.rb', line 8

def initialize(string)
  @raw = string
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



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

def raw
  @raw
end

Instance Method Details

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



20
21
22
# File 'lib/code/object/string.rb', line 20

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

#hashObject



25
26
27
# File 'lib/code/object/string.rb', line 25

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

#inspectObject



16
17
18
# File 'lib/code/object/string.rb', line 16

def inspect
  raw.inspect
end

#to_sObject



12
13
14
# File 'lib/code/object/string.rb', line 12

def to_s
  raw
end