Class: Lab42::Console::Cons
- Inherits:
-
Object
- Object
- Lab42::Console::Cons
- Defined in:
- lib/lab42/console/cons.rb
Instance Attribute Summary collapse
-
#car ⇒ Object
readonly
Returns the value of attribute car.
-
#cdr ⇒ Object
readonly
Returns the value of attribute cdr.
Instance Method Summary collapse
Instance Attribute Details
#car ⇒ Object (readonly)
Returns the value of attribute car.
5 6 7 |
# File 'lib/lab42/console/cons.rb', line 5 def car @car end |
#cdr ⇒ Object (readonly)
Returns the value of attribute cdr.
5 6 7 |
# File 'lib/lab42/console/cons.rb', line 5 def cdr @cdr end |
Instance Method Details
#apply_to_cdr(fun) ⇒ Object
7 8 9 |
# File 'lib/lab42/console/cons.rb', line 7 def apply_to_cdr(fun) self.class.new(car, fun.(cdr)) end |