Hi, Any suggetions on whats going wrong here. in /lib I hae a file flickr_code.rb module FlickrCode class FlickrCode def test @tests = ''hello'' return @tests end end end In one of my controllers I have def flickr require ''flickr_code'' oFlickr = FlickrCode::FlickrCode.new @returnvalue = oFlickr.test end As far as I can work out, this should set @returnvalue in my controller with ''hello''. However it doesnt seem to be even running this function, any ideas? -- 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 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 -~----------~----~----~----~------~----~------~--~---
dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org
2006-Oct-21 12:19 UTC
Re: modules and class''s help
Hi -- On Sat, 21 Oct 2006, scot wrote:> > Hi, > > Any suggetions on whats going wrong here. > > in /lib I hae a file flickr_code.rb > module FlickrCode > > class FlickrCode > > def test > @tests = ''hello'' > return @tests > end > end > end > > In one of my controllers I have > > def flickr > require ''flickr_code'' > oFlickr = FlickrCode::FlickrCode.new > @returnvalue = oFlickr.test > end > > As far as I can work out, this should set @returnvalue in my controller > with ''hello''. However it doesnt seem to be even running this function, > any ideas?Define "seem" and "this function" :-) David -- David A. Black | dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB''s Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---