Class: WWW::Mechanize::Form::ImageButton

Inherits:
Button
  • Object
show all
Defined in:
lib/www/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

Attributes inherited from Field

#name, #value

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ ImageButton

Returns a new instance of ImageButton.



9
10
11
12
13
# File 'lib/www/mechanize/form/image_button.rb', line 9

def initialize(name, value)
  @x = nil
  @y = nil
  super(name, value)
end

Instance Attribute Details

#xObject

Returns the value of attribute x.



7
8
9
# File 'lib/www/mechanize/form/image_button.rb', line 7

def x
  @x
end

#yObject

Returns the value of attribute y.



7
8
9
# File 'lib/www/mechanize/form/image_button.rb', line 7

def y
  @y
end

Instance Method Details

#query_valueObject



15
16
17
18
19
# File 'lib/www/mechanize/form/image_button.rb', line 15

def query_value
    super <<
     [@name + ".x", (@x || 0).to_s] <<
     [@name + ".y", (@y || 0).to_s]
end