Skip to content

Instantly share code, notes, and snippets.

@manishdas
Created August 31, 2011 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manishdas/1184399 to your computer and use it in GitHub Desktop.
Save manishdas/1184399 to your computer and use it in GitHub Desktop.
line = CF::Line.new("bizzcard_army", "Digitization")
station = CF::Station.new({:type => "work"})
line.stations station
input_format_1 = CF::InputFormat.new({:label => "Company",:field_type => "text_data",:value => "Google", :required => true, :validation_format => "general"})
input_format_2 = CF::InputFormat.new({:label => "Website",:field_type => "text_data",:value => "www.google.com", :required => true, :validation_format => "url"})
line.stations.first.input_formats input_format_1
line.stations.first.input_formats input_format_2
worker = CF::HumanWorker.new({:number => 1, :reward => 20})
line.stations.first.worker = worker
form = CF::TaskForm.new({:title => "Enter text from a business card image", :instruction => "Describe"})
line.stations.first.instruction = form
form_field_1 = CF::FormField.new({:label => "First Name", :field_type => "SA", :required => "true"})
line.stations.first.form.form_fields form_field_1
form_field_2 = CF::FormField.new({:label => "Middle Name", :field_type => "SA"})
line.stations.first.form.form_fields form_field_2
form_field_3 = CF::FormField.new({:label => "Last Name", :field_type => "SA", :required => "true"})
line.stations.first.form.form_fields form_field_3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment