Method: Fable::Container#add_content
- Defined in:
- lib/fable/container.rb
#add_content(content_to_add) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fable/container.rb', line 15 def add_content(content_to_add) if content_to_add.is_a?(Enumerable) content_to_add.each{|individual_items| add_content(individual_items) } return end debugger if content_to_add.nil? if !content_to_add.parent.nil? raise Error, "content is already in #{content_to_add.parent}" end content_to_add.parent = self content << content_to_add try_adding_to_named_content(content_to_add) end |