Module: AutomationObject::BluePrint::Composite::ContainerHelper

Included in:
Modal, Screen
Defined in:
lib/automation_object/blue_print/composite/helpers/container_helper.rb

Overview

Screen composite class

Instance Method Summary collapse

Instance Method Details

#changesArray<Symbol>

Get possible changes

Returns:

  • (Array<Symbol>)


36
37
38
39
40
41
42
43
# File 'lib/automation_object/blue_print/composite/helpers/container_helper.rb', line 36

def changes
  changes = []
  elements.merge(element_arrays).merge(element_hashes).each_value do |element|
    changes += element.changes
  end

  changes.uniq.compact
end

#element_arraysHash<AutomationObject::BluePrint::Composite::ElementArray>



25
26
27
# File 'lib/automation_object/blue_print/composite/helpers/container_helper.rb', line 25

def element_arrays
  adapter.element_arrays
end

#element_hashesHash<AutomationObject::BluePrint::Composite::ElementHash>



30
31
32
# File 'lib/automation_object/blue_print/composite/helpers/container_helper.rb', line 30

def element_hashes
  adapter.element_hashes
end

#element_to_container(name) ⇒ Symbol

Returns name and type of element

Parameters:

  • name (Symbol)

    name of container you want to go to

Returns:

  • (Symbol, Symbol)

    name and type of element



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/automation_object/blue_print/composite/helpers/container_helper.rb', line 47

def element_to_container(name)
  elements.merge(element_arrays).merge(element_hashes).each do |element_name, element|
    next unless element.changes.include?(name)

    element_type = nil

    case element
    when Element
      element_type = :elements
    when ElementArray
      element_type = :element_arrays
    when ElementHash
      element_type = :element_hashes
    end

    return element_name, element_type
  end

  [nil, nil]
end

#elementsHash<AutomationObject::BluePrint::Composite::Element>



20
21
22
# File 'lib/automation_object/blue_print/composite/helpers/container_helper.rb', line 20

def elements
  adapter.elements
end

#included_viewsArray<Symbol>

Returns:

  • (Array<Symbol>)


10
11
12
# File 'lib/automation_object/blue_print/composite/helpers/container_helper.rb', line 10

def included_views
  adapter.included_views
end

#loadAutomationObject::BluePrint::Composite::Hook



15
16
17
# File 'lib/automation_object/blue_print/composite/helpers/container_helper.rb', line 15

def load
  adapter.load
end