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
213
214
215
|
# File 'lib/chop/form.rb', line 213
def diff_value
get_value
end
|
#fill_in! ⇒ Object
203
204
205
206
207
|
# File 'lib/chop/form.rb', line 203
def fill_in!
checkboxes.each do |checkbox|
checkbox.set checkbox_label_in_values?(checkbox)
end
end
|
#get_value ⇒ Object
209
210
211
|
# File 'lib/chop/form.rb', line 209
def get_value
checkboxes.select(&:checked?).map(&:value).join(", ")
end
|
#matches? ⇒ Boolean
199
200
201
|
# File 'lib/chop/form.rb', line 199
def matches?
field[:type] == "checkbox" && field[:name].to_s.end_with?("[]")
end
|