Sha256: 2cc5152236d87aed8f4faeaaf174ae9ad325f58f9bcd1ff8e350dd7566779e93
Contents?: true
Size: 661 Bytes
Versions: 20
Compression:
Stored size: 661 Bytes
Contents
class Class # Allows the definition of methods on a class that will be available via # super. # # ==== Examples # class Foo # chainable do # def hello # "hello" # end # end # end # # class Foo # def hello # super + " Merb!" # end # end # # Foo.new.hello #=> "hello Merb!" # # ==== Parameters # &blk:: # a block containing method definitions that should be # marked as chainable # # ==== Returns # Module:: The anonymous module that was created def chainable(&blk) mod = Module.new(&blk) include mod mod end end
Version data entries
20 entries across 20 versions & 1 rubygems