Class: AutomationObject::BluePrint::HashAdapter::Modal
- Defined in:
- lib/automation_object/blue_print/hash_adapter/modal.rb
Overview
Modal-level composite, ActiveRecord style composite implementation inheriting from Composite
Instance Method Summary collapse
-
#included_views ⇒ Array<Symbol>
Array of views this can has.
-
#merge_views ⇒ Object
Method to take views and merge into this composite.
Instance Method Details
#included_views ⇒ Array<Symbol>
Returns array of views this can has
33 34 35 36 |
# File 'lib/automation_object/blue_print/hash_adapter/modal.rb', line 33 def included_views included_views_array = hash[:included_views] ||= [] included_views_array.map(&:to_sym) end |
#merge_views ⇒ Object
Method to take views and merge into this composite
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/automation_object/blue_print/hash_adapter/modal.rb', line 39 def merge_views top_hash = top.hash return unless top_hash.is_a?(Hash) return unless top_hash[:views].is_a?(Hash) top_view_hash = top_hash[:views] included_views.each do |included_view| next unless top_view_hash[included_view].is_a?(Hash) self.hash = hash.deep_merge(top_view_hash[included_view]) end end |