Class: Chop::Form::MultipleSelect
- Inherits:
-
Field
- Object
- Struct
- Field
- Chop::Form::MultipleSelect
show all
- Defined in:
- lib/chop/form.rb
Instance Attribute Summary
Attributes inherited from Field
#field, #label, #path, #session, #value
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Field
candidates, combined_css_selector, #diff_value, for, from, #get_value, #label_text, #should_include_in_diff?, #to_diff_row
Class Method Details
.css_selector ⇒ Object
156
157
158
|
# File 'lib/chop/form.rb', line 156
def self.css_selector
"select"
end
|
Instance Method Details
#fill_in! ⇒ Object
164
165
166
167
168
169
170
171
|
# File 'lib/chop/form.rb', line 164
def fill_in!
field.all("option").map(&:text).each do |value|
session.unselect value, from: label
end
value.split(", ").each do |value|
session.select value, from: label
end
end
|
#matches? ⇒ Boolean
160
161
162
|
# File 'lib/chop/form.rb', line 160
def matches?
field.tag_name == "select" && field[:multiple].to_s == "true"
end
|