lib/demiurge/container.rb in demiurge-0.2.0 vs lib/demiurge/container.rb in demiurge-0.4.0

- old
+ new

@@ -22,9 +22,17 @@ # @since 0.0.1 def contents_names state["contents"] end + # Gets the contents array as items, not names. + # + # @return [Array<Demiurge::StateItem>] The array of items contained in this item + # @since 0.3.0 + def contents + state["contents"].map { |name| @engine.item_by_name(name) } + end + # The finished_init hook is called after all items are loaded. For # containers, this makes sure all items set as contents of this # container also have it correctly set as their position. # # @return [void]