Module: AutomationObject::State::ContainerHelper

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#activeObject

Whether or not modal is active



7
8
9
# File 'lib/automation_object/state/helpers/container_helper.rb', line 7

def active
  @active
end

Instance Method Details

#active?Boolean

Returns screen is active or not

Returns:

  • (Boolean)

    screen is active or not



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

def active?
  @active ||= false
end

#changesArray<Symbol>

Returns:

  • (Array<Symbol>)


26
27
28
# File 'lib/automation_object/state/helpers/container_helper.rb', line 26

def changes
  blue_prints.changes
end

#element_to_container(name) ⇒ AutomationObject::State::Element

Parameters:

  • name (Symbol)

    name of container you want to go to

Returns:



32
33
34
35
36
37
# File 'lib/automation_object/state/helpers/container_helper.rb', line 32

def element_to_container(name)
  element_name, element_type = blue_prints.element_to_container(name)
  return unless element_name || element_type

  send(element_type)[element_name]
end

#goBoolean

Automatically find a way to go to this screen

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
# File 'lib/automation_object/state/helpers/container_helper.rb', line 16

def go
  if active?
    utilize
    return true
  end

  AutomaticRouting.new(top, name).route
end

#resetObject



39
40
41
42
43
# File 'lib/automation_object/state/helpers/container_helper.rb', line 39

def reset
  elements.values.map(&:reset)
  element_arrays.values.map(&:reset)
  element_hashes.values.map(&:reset)
end