class AutomationObject::Dsl::ScreenProxy
Public Class Methods
@param [AutomationObject::BluePrint::Composite::Screen] blue_prints @param [AutomationObject::State::Top] state @param [Symbol] name
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
Is the screen active @return [Boolean]
# File lib/automation_object/dsl/screen.rb, line 45 def active? @state.active? end
Close screen @return [void]
# File lib/automation_object/dsl/screen.rb, line 51 def close @state.close end
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
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
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 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
@param [Symbol] method @param [Array, nil] args @param [Proc] block
AutomationObject::Proxy::Proxy#method_missing
# 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
Retrieve modal or self from composite @param name [String, Symbol] name of modal @return [AutomationObject::Dsl::ModalProxy, AutomationObject::Dsl::ScreenProxy]
# File lib/automation_object/dsl/screen.rb, line 66 def modal(name) name = name.to_sym raise AutomationObject::Dsl::Error::ModalDoesNotExistError, name unless @subject.to_h.include?(name) @state.utilize return @subject.send(name) if @subject.send(name) self end