Class: AutomationObject::BluePrint::HashAdapter::View
- Defined in:
- lib/automation_object/blue_print/hash_adapter/view.rb
Overview
View composite
Instance Method Summary collapse
-
#automatic_modal_changes ⇒ Array<AutomaticModalChange>
Array of AutomaticModalChange that are defined under the screen.
-
#automatic_screen_changes ⇒ Array<Symbol>
Array of screens where screen can automatically change to.
-
#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
#automatic_modal_changes ⇒ Array<AutomaticModalChange>
Returns array of AutomaticModalChange that are defined under the screen
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/automation_object/blue_print/hash_adapter/view.rb', line 44 def automatic_modal_changes return @automatic_modal_changes if defined? @automatic_modal_changes children = hash[:automatic_modal_changes] children = children.is_a?(Array) ? children : [] @automatic_modal_changes = create_array_children(:automatic_modal_changes, children, interface: AutomaticModalChange, location: location + '[automatic_modal_change]') @automatic_modal_changes end |
#automatic_screen_changes ⇒ Array<Symbol>
Returns array of screens where screen can automatically change to
57 58 59 60 |
# File 'lib/automation_object/blue_print/hash_adapter/view.rb', line 57 def automatic_screen_changes screen_array = hash[:automatic_screen_changes] ||= [] screen_array.map(&:to_sym) end |
#included_views ⇒ Array<Symbol>
Returns array of views this can has
63 64 65 66 |
# File 'lib/automation_object/blue_print/hash_adapter/view.rb', line 63 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
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/automation_object/blue_print/hash_adapter/view.rb', line 69 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 |