You may be looking for instance_variable_get
On Nov 27, 11:16 am, James Canon
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Quick question: Given a basic plugin... how can I access an object that
> I instantiated in the acts_as method from an instance method? Probably
> some sort of accessor... but where?
>
> def self.included(base)
> base.extend ClassMethods
> end
>
> module ClassMethods
> def acts_as_test
> object = Object.new ## This object needs to be accessible from the
> Instance Methods
> end
> include Acts::As::Test::InstanceMethods
> end
>
> module InstanceMethods
> def do_something
> return object.process ## object created in acts_as_test
> end
> end
> --
> Posted viahttp://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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---