Class: Chop::Form::MultipleCheckbox
- Inherits:
-
Field
- Object
- Struct
- Field
- Chop::Form::MultipleCheckbox
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
221
222
223
|
# File 'lib/chop/form.rb', line 221
def diff_value
get_value
end
|
#fill_in! ⇒ Object
211
212
213
214
215
|
# File 'lib/chop/form.rb', line 211
def fill_in!
checkboxes.each do |checkbox|
checkbox.set checkbox_label_in_values?(checkbox)
end
end
|
#get_value ⇒ Object
217
218
219
|
# File 'lib/chop/form.rb', line 217
def get_value
checkboxes.select(&:checked?).map(&:value).join(", ")
end
|
#matches? ⇒ Boolean
207
208
209
|
# File 'lib/chop/form.rb', line 207
def matches?
field[:type] == "checkbox" && field[:name].to_s.end_with?("[]")
end
|