Class: AutomationObject::Dsl::TopProxy

Inherits:
Proxy show all
Defined in:
lib/automation_object/dsl/top.rb

Overview

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

Instance Method Summary collapse

Methods inherited from Proxy::Proxy

#method_missing

Constructor Details

#initialize(blue_prints, state, name) ⇒ TopProxy

Returns a new instance of TopProxy

Parameters:



22
23
24
# File 'lib/automation_object/dsl/top.rb', line 22

def initialize(blue_prints, state, name)
  super Top, blue_prints, state, name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class AutomationObject::Proxy::Proxy

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/automation_object/dsl/top.rb', line 26

def active?
  true
end

#current_screenAutomationObject::Dsl::ScreenProxy

Current Screen



43
44
45
# File 'lib/automation_object/dsl/top.rb', line 43

def current_screen
  @subject.send(@state.current_screen)
end

#screen(name) ⇒ AutomationObject::Dsl::ScreenProxy

Retrieve screen from composite

Parameters:

  • name (String, Symbol)

    name of screen

Returns:

Raises:



34
35
36
37
38
39
# 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