From: Cris Shupp Date: 2009-08-14T03:40:42+09:00 Subject: Re: skip_before_filter (Do I need a lesson in modules/mixins?) No it is not the fact that the method call is not within another method call that is tripping me up. It is that I cannot get it to work for me. Consider the following code: #################################### module Test def self.include(base) base.extend(ClassMethods) end module ClassMethods def call_me puts "Class method" end end end class Tester include Test call_me#toy.rb:23: undefined method `call_me' for Tester:Class(NoMethodError) end Tester.new ################################### yields the following results: toy.rb:24: undefined local variable or method `call_me' for Tester:Class (NameError) Again I am assuming my 'call_me' is equivalent to my originally referenced 'skip_before_filter'. Thanks, Cris pharrington wrote: > On Aug 13, 10:19�am, Cris Shupp wrote: >> I should mention that I am seeing these 'dangling' calls more and more >> as I look through what the scaffolding generated so I would like a clue! >> >> Thanks, >> >> Cris >> -- >> Posted viahttp://www.ruby-forum.com/. > > Is it the fact that the method calls aren't happening within another > method tripping you up? In Ruby, most everything happens at runtime, > class creation included. Also, everything's an object. So when > something like > > class Foo; some_ish; end > > happens, Ruby is creating a new class, and some_ish is just being run > in the instance of the Class that is being created. (well it *is* more > complicated than that, but that should be enough to help understand > whats going on?). Its really no different than attr_accessor and > friends. -- Posted via http://www.ruby-forum.com/.