Class: Rupture::Cons
- Defined in:
- lib/rupture/cons.rb
Instance Attribute Summary collapse
-
#first ⇒ Object
readonly
Returns the value of attribute first.
Instance Method Summary collapse
-
#initialize(first, rest) ⇒ Cons
constructor
A new instance of Cons.
- #rest ⇒ Object
- #seq ⇒ Object
Methods inherited from Seq
#==, #[], #each, empty, #to_ary
Methods included from Sequence
#concat, #conj, #count, #doall, #drop, #drop_last, #drop_while, #empty?, #every?, #filter, #flatten, #foldr, #inspect, #into, #last, #map, #mapcat, #next, #not_empty, #nth, #partition, #partition_all, #partition_between, #partition_by, #reduce, #remove, #reverse, #second, #separate, #sequential?, #some, #split_at, #split_with, #take, #take_last, #take_while, #tree_seq
Constructor Details
#initialize(first, rest) ⇒ Cons
Returns a new instance of Cons.
5 6 7 8 |
# File 'lib/rupture/cons.rb', line 5 def initialize(first, rest) @first, @rest = first, rest super() end |
Instance Attribute Details
#first ⇒ Object (readonly)
Returns the value of attribute first.
3 4 5 |
# File 'lib/rupture/cons.rb', line 3 def first @first end |