Class: Mechanize::Form::CheckBox

Inherits:
RadioButton show all
Defined in:
lib/mechanize/form/check_box.rb

Overview

This class represents a check box found in a Form. To activate the CheckBox in the Form, set the checked method to true.

Instance Attribute Summary

Attributes inherited from RadioButton

#checked, #form

Attributes inherited from Field

#index, #name, #node, #raw_value, #type, #value

Instance Method Summary collapse

Methods inherited from RadioButton

#==, #[], #check, #click, #hash, #initialize, #label, #pretty_print_instance_variables, #text, #uncheck

Methods inherited from Field

#<=>, #dom_class, #dom_id, #initialize

Constructor Details

This class inherits a constructor from Mechanize::Form::RadioButton

Instance Method Details

#inspectObject

:nodoc:



12
13
14
15
16
17
# File 'lib/mechanize/form/check_box.rb', line 12

def inspect # :nodoc:
  "[%s:0x%x type: %s name: %s value: %s]" % [
    self.class.name.sub(/Mechanize::Form::/, '').downcase,
    object_id, type, name, checked
  ]
end

#query_valueObject



8
9
10
# File 'lib/mechanize/form/check_box.rb', line 8

def query_value
  [[@name, @value || "on"]]
end