class Chop::Form::Radio

Public Instance Methods

fill_in!() click to toggle source
# File lib/chop/form.rb, line 152
def fill_in!
  if nonstandard_labelling?
    value_field.click
  else
    session.choose label
  end
end
get_value() click to toggle source
# File lib/chop/form.rb, line 160
def get_value
  session.all("[name='#{field[:name]}']").find(&:checked?).try(:value)
end
matches?() click to toggle source
# File lib/chop/form.rb, line 148
def matches?
  field[:type] == "radio"
end

Private Instance Methods

nonstandard_labelling?() click to toggle source
# File lib/chop/form.rb, line 166
def nonstandard_labelling?
  value_field[:name] == field[:name]
end
value_field() click to toggle source
# File lib/chop/form.rb, line 170
def value_field
  session.all(:field, value).select { |el| el[:name] == field[:name] }.last || {}
end