Class: Literal::Tuple
- Inherits:
-
Object
- Object
- Literal::Tuple
- Defined in:
- lib/literal/tuple.rb
Defined Under Namespace
Classes: Generic
Instance Attribute Summary collapse
-
#__types__ ⇒ Object
readonly
Returns the value of attribute __types__.
-
#__values__ ⇒ Object
readonly
Returns the value of attribute __values__.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](index) ⇒ Object
-
#initialize(values, types) ⇒ Tuple
constructor
A new instance of Tuple.
- #inspect ⇒ Object
Constructor Details
#initialize(values, types) ⇒ Tuple
54 55 56 57 |
# File 'lib/literal/tuple.rb', line 54 def initialize(values, types) @__values__ = values @__types__ = types end |
Instance Attribute Details
#__types__ ⇒ Object (readonly)
Returns the value of attribute __types__.
63 64 65 |
# File 'lib/literal/tuple.rb', line 63 def __types__ @__types__ end |
#__values__ ⇒ Object (readonly)
Returns the value of attribute __values__.
63 64 65 |
# File 'lib/literal/tuple.rb', line 63 def __values__ @__values__ end |
Instance Method Details
#==(other) ⇒ Object
65 66 67 |
# File 'lib/literal/tuple.rb', line 65 def ==(other) (Literal::Tuple === other) && (@__values__ == other.__values__) end |
#[](index) ⇒ Object
69 70 71 |
# File 'lib/literal/tuple.rb', line 69 def [](index) @__values__[index] end |
#inspect ⇒ Object
59 60 61 |
# File 'lib/literal/tuple.rb', line 59 def inspect "Literal::Tuple(#{@__types__.map(&:inspect).join(', ')})#{@__values__.inspect}" end |