class AutomationObject::Dsl::TopProxy

Proxy for Top Composite Use proxy for methods trying to do a @state call

Public Class Methods

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

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

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

Public Instance Methods

active?() click to toggle source
# File lib/automation_object/dsl/top.rb, line 26
def active?
  true
end
current_screen() click to toggle source

Current Screen @return [AutomationObject::Dsl::ScreenProxy]

# File lib/automation_object/dsl/top.rb, line 43
def current_screen
  @subject.send(@state.current_screen)
end
screen(name) click to toggle source

Retrieve screen from composite @param name [String, Symbol] name of screen @raise [AutomationObject::Dsl::Error::ScreenDoesNotExistError] @return [AutomationObject::Dsl::ScreenProxy]

# File lib/automation_object/dsl/top.rb, line 34
def screen(name)
  name = name.to_sym
  raise AutomationObject::Dsl::Error::ScreenDoesNotExistError, name unless @subject.to_h.include?(name)

  @subject.send(name)
end