Class: Perspectives::Collection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/perspectives/collection.rb

Instance Method Summary collapse

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_htmlObject Also known as: to_s



13
14
15
# File 'lib/perspectives/collection.rb', line 13

def to_html
  perspectives.map(&:to_html).join
end