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
137
138
139
140
141
142
143
|
# File 'lib/chop/form.rb', line 137
def fill_in!
if nonstandard_labelling?
value_field.click
else
session.choose label
end
end
|
#get_value ⇒ Object
145
146
147
|
# File 'lib/chop/form.rb', line 145
def get_value
session.all("[name='#{field[:name]}']").find(&:checked?).try(:value)
end
|
#matches? ⇒ Boolean
133
134
135
|
# File 'lib/chop/form.rb', line 133
def matches?
field[:type] == "radio"
end
|