Method: Lookbook::Collection#initialize
- Defined in:
- lib/lookbook/collection.rb
#initialize(path = "", items = []) ⇒ Collection
Returns a new instance of Collection.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/lookbook/collection.rb', line 7 def initialize(path = "", items = []) @items = [] if path.is_a?(Array) items = path path = "" end @path = path.delete_prefix("/").delete_suffix("/") super(@path) items.each { |item| add(item) } end |