Class: Mohawk::Accessors::Button
- Inherits:
-
Object
- Object
- Mohawk::Accessors::Button
- Defined in:
- lib/mohawk/accessors/button.rb
Instance Attribute Summary collapse
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
- #click(&block) ⇒ Object
-
#initialize(adapter, locator) ⇒ Button
constructor
A new instance of Button.
- #value ⇒ Object
Constructor Details
#initialize(adapter, locator) ⇒ Button
Returns a new instance of Button.
6 7 8 |
# File 'lib/mohawk/accessors/button.rb', line 6 def initialize(adapter, locator) @view = adapter.window.(locator) end |
Instance Attribute Details
#view ⇒ Object (readonly)
Returns the value of attribute view.
4 5 6 |
# File 'lib/mohawk/accessors/button.rb', line 4 def view @view end |
Instance Method Details
#click(&block) ⇒ Object
10 11 12 13 |
# File 'lib/mohawk/accessors/button.rb', line 10 def click(&block) @view.click &block if block @view.click {true} unless block end |
#value ⇒ Object
15 16 17 |
# File 'lib/mohawk/accessors/button.rb', line 15 def value @view.value end |