Class: Code::Object::List
- Inherits:
-
Code::Object
- Object
- Code::Object
- Code::Object::List
- Defined in:
- lib/code/object/list.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(raw) ⇒ List
constructor
A new instance of List.
- #inspect ⇒ Object
- #join ⇒ Object
- #map(&block) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Code::Object
Constructor Details
#initialize(raw) ⇒ List
Returns a new instance of List.
6 7 8 |
# File 'lib/code/object/list.rb', line 6 def initialize(raw) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
4 5 6 |
# File 'lib/code/object/list.rb', line 4 def raw @raw end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
27 28 29 |
# File 'lib/code/object/list.rb', line 27 def ==(other) raw == other.raw end |
#hash ⇒ Object
32 33 34 |
# File 'lib/code/object/list.rb', line 32 def hash [self.class, raw].hash end |
#inspect ⇒ Object
14 15 16 |
# File 'lib/code/object/list.rb', line 14 def inspect to_s end |
#join ⇒ Object
23 24 25 |
# File 'lib/code/object/list.rb', line 23 def join raw.join end |
#map(&block) ⇒ Object
18 19 20 21 |
# File 'lib/code/object/list.rb', line 18 def map(&block) @raw = raw.map(&block) self end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/code/object/list.rb', line 10 def to_s "[#{raw.map(&:inspect).join(", ")}]" end |