Class: Code::Object::String
- Inherits:
-
Code::Object
- Object
- Code::Object
- Code::Object::String
- Defined in:
- lib/code/object/string.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(string) ⇒ String
constructor
A new instance of String.
- #inspect ⇒ Object
- #to_s ⇒ Object
Methods inherited from Code::Object
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
#raw ⇒ Object (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 |
#hash ⇒ Object
25 26 27 |
# File 'lib/code/object/string.rb', line 25 def hash [self.class, raw].hash end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/code/object/string.rb', line 16 def inspect raw.inspect end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/code/object/string.rb', line 12 def to_s raw end |