They are all very different, although all return a similar hash of
arguments.

Here is an example...

def vergence_v
  u = (rand(2..6)).round(2)
  u_vergence =((1/(u*0.01)).round(2))
  p = rand((u_vergence + 0.1) ..(u_vergence + 0.7)).round(2)
  v_vergence = (p - u_vergence).round(2)
  v = (1/v_vergence).round(2)

  question = "A slide is placed #{u} cm to the left of a +#{p} D lens.
At what distance (in meters) will the screen need to be placed to the
right of the lens to have the image be in perfect focus?"

  answer = "Answer = #{v} meters"
  anno = "Solution:......"

  formatted = {"question_1" => question, "answer_1" => answer, "anno_1"
=> anno}

end

Could this be saved as a string in the database, and then be written to 
a temp file and "required" by the model when it is needed?

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to