Class: Hokusai::Automation::DriverCommands::GetAttribute
- Defined in:
- ui/src/hokusai/automation/driver_commands/get_attribute.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Base
#last_parent, #request_id, #state, #status
Instance Method Summary collapse
- #attribute_name ⇒ Object
- #execute(blocks, canvas, input) ⇒ Object
-
#initialize(state) ⇒ GetAttribute
constructor
A new instance of GetAttribute.
- #location ⇒ Object
- #on_complete ⇒ Object
Methods inherited from Base
#matches_block, #matches_blocks, #mouse_center, #mouse_move
Constructor Details
#initialize(state) ⇒ GetAttribute
Returns a new instance of GetAttribute.
6 7 8 9 10 |
# File 'ui/src/hokusai/automation/driver_commands/get_attribute.rb', line 6 def initialize(state) @value = nil super end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'ui/src/hokusai/automation/driver_commands/get_attribute.rb', line 4 def value @value end |
Instance Method Details
#attribute_name ⇒ Object
16 17 18 |
# File 'ui/src/hokusai/automation/driver_commands/get_attribute.rb', line 16 def attribute_name state[:attribute_name] end |
#execute(blocks, canvas, input) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'ui/src/hokusai/automation/driver_commands/get_attribute.rb', line 30 def execute(blocks, canvas, input) return unless matches_block(blocks[0]) Log.debug { "Props: #{blocks[0].node..props}".colorize(:yellow) } attribute = blocks[0].node..props[attribute_name.to_sym] self.value = attribute end |
#location ⇒ Object
12 13 14 |
# File 'ui/src/hokusai/automation/driver_commands/get_attribute.rb', line 12 def location state[:uuid] end |
#on_complete ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'ui/src/hokusai/automation/driver_commands/get_attribute.rb', line 20 def on_complete done! if value.nil? return ::Hokusai::Automation::Error.new("Attribute #{attribute_name} not found") end return value end |