Adios' Notes

« Back to posts
  • Viewed
    times

Filed under

  • programming
  • ruby
April 19, 2010

[ruby-talk:14594] Re: Module method definition question

  • Edit
  • Delete
  • Tags
  • Autopost
Assuming you meant 'module A', the first defines an instance method, the second a module method. The instance method cannot be called until the module is mixed in to a class using 'include'. The module method can be called by giving the module name as a receiver:
via blade.nagaokaut.ac.jp

instance method 只有在被 mixed 的時候才有用

Tweet
  • 0 responses
  • Like
  • Comment