class AutomationObject::Dsl::ModalProxy

Proxy for Modal

Public Class Methods

new(blue_prints, state, name) click to toggle source

@param [AutomationObject::BluePrint::Composite::Modal] blue_prints @param [AutomationObject::State::Screen] state @param [Symbol] name

Calls superclass method AutomationObject::Dsl::Proxy::new
# File lib/automation_object/dsl/modal.rb, line 25
def initialize(blue_prints, state, name)
  super Modal, blue_prints, state, name
end

Public Instance Methods

active?() click to toggle source

@return [Boolean]

# File lib/automation_object/dsl/modal.rb, line 42
def active?
  @state.active?
end
element(name) click to toggle source

Retrieve element from composite @param name [String, Symbol] name of element @raise [AutomationObject::Dsl::Error::ElementDoesNotExistError] @return [AutomationObject::Dsl::ElementProxy]

# File lib/automation_object/dsl/modal.rb, line 58
def element(name)
  name = name.to_sym
  raise AutomationObject::Dsl::Error::ElementDoesNotExistError, name unless @subject.to_h.include?(name)

  @state.utilize
  @subject.send(name)
end
element_array(name) click to toggle source

Retrieve element array from composite @param name [String, Symbol] name of element array @raise [AutomationObject::Dsl::Error::ElementArrayDoesNotExistError] @return [AutomationObject::Dsl::ElementArrayProxy]

# File lib/automation_object/dsl/modal.rb, line 70
def element_array(name)
  name = name.to_sym
  raise AutomationObject::Dsl::Error::ElementArrayDoesNotExistError, name unless @subject.to_h.include?(name)

  @state.utilize
  @subject.send(name)
end
element_hash(name) click to toggle source

Retrieve element hash from composite @param name [String, Symbol] name of element hash @raise [AutomationObject::Dsl::Error::ElementHashDoesNotExistError] @return [AutomationObject::Dsl::ElementHashProxy]

# File lib/automation_object/dsl/modal.rb, line 82
def element_hash(name)
  name = name.to_sym
  raise AutomationObject::Dsl::Error::ElementHashDoesNotExistError, name unless @subject.to_h.include?(name)

  @state.utilize
  @subject.send(name)
end
go() click to toggle source

Go to this modal Will try to automatically reach it, will throw error if it cannot @raise [AutomationObject::Dsl::Error::AutoReachModalError] @return [Boolean]

# File lib/automation_object/dsl/modal.rb, line 50
def go
  @state.go
end
method_missing(method, *args, &block) click to toggle source

@param [Symbol] method @param [Array, nil] args @param [Proc] block

# File lib/automation_object/dsl/modal.rb, line 32
def method_missing(method, *args, &block)
  return super if Modal.methods.include?(method)

  # Attempt to load modal if composite object contains that child
  @state.utilize if @subject.to_h.include?(method)

  super
end