Class: Shoehorn::HelperCollectionSet

Inherits:
Object
  • Object
show all
Defined in:
lib/shoehorn/helper_collection_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view, items) ⇒ HelperCollectionSet

Returns a new instance of HelperCollectionSet.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/shoehorn/helper_collection_set.rb', line 5

def initialize(view, items)
  @collections = {}
  items.each do |item|
    @collections[item] = Shoehorn::HelperCollection.new(view)
    instance_eval <<-EOF
      def#{item}
        yield @collections[#{item.inspect} ]
      end
    EOF
  end
end

Instance Attribute Details

#collectionsObject

Returns the value of attribute collections.



3
4
5
# File 'lib/shoehorn/helper_collection_set.rb', line 3

def collections
  @collections
end