Gigawiki.com
Include and Extend
2011-05-10 16:23:02
2011-05-10 16:22:10
Autor:
Sony Santos
(sony)
https://gigawiki.com/sony/include-and-extend
Permalink:
https://gigawiki.com/993
language = English, ruby
module Foo
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def bar
puts 'class method'
end
end
def foo
puts 'instance method'
end
end
class Baz
include Foo
end
Please enable JavaScript to view the
comments powered by Disqus.
blog comments powered by
Disqus
Login:
Senha:
Para logar, você precisa ter o Javascript habilitado.
Busca avançada
language = English
Internal Frame
How to run firefox on Docker
URL: Ranges in Query Strings
Ruby Coding Style
Android "Modem log is on the way"
Unicode hbar for Planck's Constant
How to show Dropbox Icons in Ubuntu
Include and Extend
Two ways to simplify Array blocks in Ruby
Ruby autoload like in PHP
Mais...
language = ruby
Include and Extend
Ruby autoload like in PHP
attr_reader for class variables
Trying to understand metaclasses
Versão desktop