Class: Hokusai::Automation::DriverCommands::Invoke

Inherits:
Base
  • Object
show all
Defined in:
ui/src/hokusai/automation/driver_commands/invoke.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#last_parent, #request_id, #state, #status

Instance Method Summary collapse

Methods inherited from Base

#matches_block, #matches_blocks, #mouse_center, #mouse_move

Constructor Details

#initialize(hash) ⇒ Invoke

Returns a new instance of Invoke.



14
15
16
17
18
# File 'ui/src/hokusai/automation/driver_commands/invoke.rb', line 14

def initialize(hash)
  @value = nil

  super
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



4
5
6
# File 'ui/src/hokusai/automation/driver_commands/invoke.rb', line 4

def value
  @value
end

Instance Method Details

#execute(block, canvas, input) ⇒ Object



24
25
26
27
28
29
30
# File 'ui/src/hokusai/automation/driver_commands/invoke.rb', line 24

def execute(block, canvas, input)
  return unless matches_block(blocks[0])

  self.value = blocks[0].public_send(method)

  done!
end

#locationObject



6
7
8
# File 'ui/src/hokusai/automation/driver_commands/invoke.rb', line 6

def location
  state[:uuid]
end

#methodObject



10
11
12
# File 'ui/src/hokusai/automation/driver_commands/invoke.rb', line 10

def method
  state[:method]
end

#on_completeObject



20
21
22
# File 'ui/src/hokusai/automation/driver_commands/invoke.rb', line 20

def on_complete
  return value if done?
end