| Class | Module |
| In: |
lib/facet/macro.rb
|
| Parent: | Object |
A macro construction for creating dynamic mixins.
module Mixin
macro { |options| %{
def hello
puts 'Hello from #{options[:name]}'
end
} }
end
class MyClass
include Mixin, :name => 'tml'
end
m = MyClass.new
m.hello -> 'Hello from tml'
| include | -> | include_without_macros |
| extend | -> | extend_without_macros |