File: image_button.rb

package info (click to toggle)
ruby-mechanize 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,516 kB
  • sloc: ruby: 11,754; makefile: 7; sh: 2
file content (20 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true
##
# 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".

class Mechanize::Form::ImageButton < Mechanize::Form::Button
  attr_accessor :x, :y

  def initialize *args
    @x = nil
    @y = nil
    super
  end

  def query_value
    [["#{@name}.x", (@x || 0).to_s],
     ["#{@name}.y", (@y || 0).to_s]]
  end
end