Class: Chop::Form::SingleFile

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, #get_value, #label_text, #should_include_in_diff?, #to_diff_row

Instance Method Details

#fill_in!Object



281
282
283
284
# File 'lib/chop/form.rb', line 281

def fill_in!
  assert_single_file!
  field.set file_path
end

#matches?Boolean

Returns:

  • (Boolean)


277
278
279
# File 'lib/chop/form.rb', line 277

def matches?
  field[:type] == "file" && !field[:multiple]
end