Class: Mechanize::Form::ImageButton
- Defined in:
- lib/mechanize/form/image_button.rb
Overview
This class represents an image button in a form. Use the x and y methods to set the x and y positions for where the mouse “clicked”.
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Attributes inherited from Field
#index, #name, #node, #raw_value, #type, #value
Instance Method Summary collapse
-
#initialize(*args) ⇒ ImageButton
constructor
A new instance of ImageButton.
- #query_value ⇒ Object
Methods inherited from Field
#<=>, #dom_class, #dom_id, #inspect
Constructor Details
#initialize(*args) ⇒ ImageButton
Returns a new instance of ImageButton.
9 10 11 12 13 |
# File 'lib/mechanize/form/image_button.rb', line 9 def initialize *args @x = nil @y = nil super end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
7 8 9 |
# File 'lib/mechanize/form/image_button.rb', line 7 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
7 8 9 |
# File 'lib/mechanize/form/image_button.rb', line 7 def y @y end |
Instance Method Details
#query_value ⇒ Object
15 16 17 18 |
# File 'lib/mechanize/form/image_button.rb', line 15 def query_value [["#{@name}.x", (@x || 0).to_s], ["#{@name}.y", (@y || 0).to_s]] end |