Class: Perspectives::Collection
- Inherits:
-
Object
- Object
- Perspectives::Collection
- Includes:
- Enumerable
- Defined in:
- lib/perspectives/collection.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(perspectives) ⇒ Collection
constructor
A new instance of Collection.
- #to_html ⇒ Object (also: #to_s)
Constructor Details
#initialize(perspectives) ⇒ Collection
Returns a new instance of Collection.
5 6 7 |
# File 'lib/perspectives/collection.rb', line 5 def initialize(perspectives) @perspectives = perspectives end |
Instance Method Details
#each(&block) ⇒ Object
9 10 11 |
# File 'lib/perspectives/collection.rb', line 9 def each(&block) perspectives.each(&block) end |
#to_html ⇒ Object Also known as: to_s
13 14 15 |
# File 'lib/perspectives/collection.rb', line 13 def to_html perspectives.map(&:to_html).join end |