Class: Lab42::Triple
- Inherits:
-
Object
- Object
- Lab42::Triple
- Includes:
- EqAndPatterns
- Defined in:
- lib/lab42/triple.rb
Instance Attribute Summary collapse
-
#first ⇒ Object
readonly
Returns the value of attribute first.
-
#second ⇒ Object
readonly
Returns the value of attribute second.
-
#third ⇒ Object
readonly
Returns the value of attribute third.
Instance Method Summary collapse
- #set_first(new_first) ⇒ Object
- #set_second(new_second) ⇒ Object
- #set_third(new_third) ⇒ Object
- #to_a ⇒ Object
Methods included from EqAndPatterns
Instance Attribute Details
#first ⇒ Object (readonly)
Returns the value of attribute first.
6 7 8 |
# File 'lib/lab42/triple.rb', line 6 def first @first end |
#second ⇒ Object (readonly)
Returns the value of attribute second.
6 7 8 |
# File 'lib/lab42/triple.rb', line 6 def second @second end |
#third ⇒ Object (readonly)
Returns the value of attribute third.
6 7 8 |
# File 'lib/lab42/triple.rb', line 6 def third @third end |
Instance Method Details
#set_first(new_first) ⇒ Object
13 |
# File 'lib/lab42/triple.rb', line 13 def set_first(new_first) = self.class.new(new_first, second, third) |
#set_second(new_second) ⇒ Object
14 |
# File 'lib/lab42/triple.rb', line 14 def set_second(new_second) = self.class.new(first, new_second, third) |
#set_third(new_third) ⇒ Object
15 |
# File 'lib/lab42/triple.rb', line 15 def set_third(new_third) = self.class.new(first, second, new_third) |
#to_a ⇒ Object
9 10 11 |
# File 'lib/lab42/triple.rb', line 9 def to_a [first, second, third] end |