Class: Chop::Form::Radio

Inherits:
Field
  • Object
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, #diff_value, for, from, #label_text, #should_include_in_diff?, #to_diff_row

Instance Method Details

#fill_in!Object



249
250
251
252
253
254
255
# File 'lib/chop/form.rb', line 249

def fill_in!
  if nonstandard_labelling?
    value_field.click
  else
    session.choose label
  end
end

#get_valueObject



257
258
259
# File 'lib/chop/form.rb', line 257

def get_value
  session.all("[name='#{field[:name]}']").find(&:checked?).try(:value)
end

#matches?Boolean

Returns:

  • (Boolean)


245
246
247
# File 'lib/chop/form.rb', line 245

def matches?
  field[:type] == "radio"
end