On Tue, Sep 4, 2012 at 9:37 AM, Dave Castellano <[email protected]> wrote:

> Tempfile.open(["hello_world", ".rb"], "./lib/generators") do |file|

> If the file is a method, how can I call the method here and get the returned
> arguments?

The file can't "be" a method, but it may contain a string describing a
method. You can read that string and invoke it using `eval`.

See: http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-eval

HTH,
-- 
Hassan Schroeder ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

-- 
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