Class: IronNails::Core::Collection
- Inherits:
-
Object
- Object
- IronNails::Core::Collection
show all
- Includes:
- Enumerable
- Defined in:
- lib/ironnails/view/collections.rb
Instance Method Summary
collapse
Constructor Details
#initialize(*items) ⇒ Collection
Returns a new instance of Collection.
9
10
11
|
# File 'lib/ironnails/view/collections.rb', line 9
def initialize(*items)
@items = items || []
end
|
Instance Method Details
#<<(item) ⇒ Object
19
20
21
|
# File 'lib/ironnails/view/collections.rb', line 19
def <<(item)
@items << item
end
|
#[](value) ⇒ Object
23
24
25
|
# File 'lib/ironnails/view/collections.rb', line 23
def [](value)
@items[value]
end
|
#each ⇒ Object
13
14
15
16
17
|
# File 'lib/ironnails/view/collections.rb', line 13
def each
@items.each do |item|
yield item
end
end
|
#to_a ⇒ Object
27
28
29
|
# File 'lib/ironnails/view/collections.rb', line 27
def to_a
@items
end
|