Class: Chop::Form::Radio
- Inherits:
-
Field
- Object
- Struct
- Field
- Chop::Form::Radio
show all
- Defined in:
- lib/chop/form.rb
Instance Attribute Summary
Attributes inherited from Field
#field, #label, #path, #session, #value
Instance Method Summary
collapse
Methods inherited from Field
candidates, for, from
Instance Method Details
#fill_in! ⇒ Object
152
153
154
155
156
157
158
|
# File 'lib/chop/form.rb', line 152
def fill_in!
if nonstandard_labelling?
value_field.click
else
session.choose label
end
end
|
#get_value ⇒ Object
160
161
162
|
# File 'lib/chop/form.rb', line 160
def get_value
session.all("[name='#{field[:name]}']").find(&:checked?).try(:value)
end
|
#matches? ⇒ Boolean
148
149
150
|
# File 'lib/chop/form.rb', line 148
def matches?
field[:type] == "radio"
end
|