Class: AutomationObject::State::Modal

Inherits:
Base show all
Includes:
ContainerHelper
Defined in:
lib/automation_object/state/modal.rb

Overview

Modal composite for managing state

Instance Attribute Summary

Attributes included from ContainerHelper

#active

Attributes inherited from Base

#blue_prints, #driver

Attributes inherited from Composite

#children, #location, #name, #parent

Instance Method Summary collapse

Methods included from ContainerHelper

#active?, #changes, #element_to_container, #go, #reset

Methods inherited from Base

#get_child, #get_children, #initialize, #screen, #top

Methods inherited from Composite

#add_has_many_relationships, #add_has_one_relationships, #get_child, #get_children, has_many, has_many_relationships, has_one, has_one_relationships, #initialize, #top

Methods included from Reflection

#add_alias, #add_attribute

Methods included from CompositeHook

#after_create_run, #before_create_run, included

Constructor Details

This class inherits a constructor from AutomationObject::State::Base

Instance Method Details

#activateObject



28
29
30
# File 'lib/automation_object/state/modal.rb', line 28

def activate
  @active = true
end

#deactivateObject



32
33
34
35
# File 'lib/automation_object/state/modal.rb', line 32

def deactivate
  @active = false
  reset
end

#utilizeObject



24
25
26
# File 'lib/automation_object/state/modal.rb', line 24

def utilize
  raise ModalNotActiveError, name unless active?
end