class AutomationObject::BluePrint::HashAdapter::HookAction

Hook action composite

Public Instance Methods

change_screen() click to toggle source

@return [Symbol, nil] screen to change to

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 50
def change_screen
  change_screen = hash[:change_screen]

  case change_screen
  when Symbol, String
    return change_screen.to_sym
  else
    return nil
  end
end
change_to_previous_screen() click to toggle source

@return [Boolean]

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 84
def change_to_previous_screen
  hash[:change_to_previous_screen] ||= false
end
close_modal() click to toggle source

@return [Boolean]

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 79
def close_modal
  hash[:close_modal] ||= false
end
close_screen() click to toggle source

@return [Boolean]

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 74
def close_screen
  hash[:close_screen] ||= false
end
empty?() click to toggle source

See if hook actions are empty @return [Boolean] if hook actions are empty

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 45
def empty?
  hash.keys.empty?
end
hook_order() click to toggle source

Get the order to run the hook in @return [Array<Symbol>] list of hook methods to run in given order

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 33
def hook_order
  hash.keys
end
length() click to toggle source

Get length of hook actions @return [Integer] length of hook actions

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 39
def length
  hash.keys.length
end
new_screen() click to toggle source

@return [Symbol, nil] new screen

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 62
def new_screen
  new_screen = hash[:new_screen]

  case new_screen
  when Symbol, String
    return new_screen.to_sym
  else
    return nil
  end
end
possible_screen_changes() click to toggle source

@return [Array]

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 101
def possible_screen_changes
  return hash[:possible_screen_changes].map(&:to_sym) if hash[:possible_screen_changes].is_a?(Array)

  []
end
reset_screen() click to toggle source

@return [Boolean] reset the screen?

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 108
def reset_screen
  hash[:reset_screen] ||= false
end
show_modal() click to toggle source

@return [Symbol, nil]

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 89
def show_modal
  show_modal = hash[:show_modal]

  case show_modal
  when Symbol, String
    return show_modal.to_sym
  else
    return nil
  end
end
sleep() click to toggle source

@return [Numeric] amount of time to sleep

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 113
def sleep
  hash[:sleep] ||= 0
end
wait_for_elements() click to toggle source

Custom method for array of children instead of Hash @return [Array<HookElementRequirements>] array of wait for element children

# File lib/automation_object/blue_print/hash_adapter/hook_action.rb, line 119
def wait_for_elements
  return @wait_for_elements if defined? @wait_for_elements
  wait_for_elements = hash[:wait_for_elements]

  children = wait_for_elements.is_a?(Array) ? wait_for_elements : []
  @wait_for_elements = create_array_children(:wait_for_elements, children,
                                             interface: HookElementRequirements,
                                             location: location + '[wait_for_elements]')

  @wait_for_elements
end