Class: Chop::Form::Checkbox
- Inherits:
-
Field
- Object
- Struct
- Field
- Chop::Form::Checkbox
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, combined_css_selector, css_selector, for, from, #label_text, #should_include_in_diff?, #to_diff_row
Instance Method Details
#diff_value ⇒ Object
251
252
253
|
# File 'lib/chop/form.rb', line 251
def diff_value
get_value
end
|
#fill_in! ⇒ Object
243
244
245
|
# File 'lib/chop/form.rb', line 243
def fill_in!
field.set value.present?
end
|
#get_value ⇒ Object
247
248
249
|
# File 'lib/chop/form.rb', line 247
def get_value
field.checked? ? "✓" : ""
end
|
#matches? ⇒ Boolean
239
240
241
|
# File 'lib/chop/form.rb', line 239
def matches?
field[:type] == "checkbox" && !field[:name].to_s.end_with?("[]")
end
|