class AutomationObject::Dsl::ScreenProxy

Proxy for Screen

Public Class Methods

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

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

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

Public Instance Methods

active?() click to toggle source

Is the screen active @return [Boolean]

# File lib/automation_object/dsl/screen.rb, line 45
def active?
  @state.active?
end
close() click to toggle source

Close screen @return [void]

# File lib/automation_object/dsl/screen.rb, line 51
def close
  @state.close
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/screen.rb, line 80
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/screen.rb, line 92
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/screen.rb, line 104
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 screen Will try to automatically reach it, will throw error if it cannot @raise [AutomationObject::Dsl::Error::AutoReachScreenError] @return [Boolean]

# File lib/automation_object/dsl/screen.rb, line 59
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/screen.rb, line 34
def method_missing(method, *args, &block)
  return super if Screen.methods.include?(method)

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

  super
end
modal(name) click to toggle source

Retrieve modal or self from composite @param name [String, Symbol] name of modal @return [AutomationObject::Dsl::ModalProxy, AutomationObject::Dsl::ScreenProxy]