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
158
159
160
161
162
163
164
|
# File 'lib/chop/form.rb', line 158
def fill_in!
if nonstandard_labelling?
value_field.click
else
session.choose label
end
end
|
#get_value ⇒ Object
166
167
168
|
# File 'lib/chop/form.rb', line 166
def get_value
session.all("[name='#{field[:name]}']").find(&:checked?).try(:value)
end
|
#matches? ⇒ Boolean
154
155
156
|
# File 'lib/chop/form.rb', line 154
def matches?
field[:type] == "radio"
end
|