A macro construction for creating dynamic mixins.
Example
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'
Author(s)
- George Moschovitis <gm@navel.gr>
- Thomas Sawyer
Methods
- append_dynamic_features
- append_features
- attr_parameter
- attr_parameters
- extend
- extend_dynamic_object
- include
- include
- include_without_macros
- local_parameters
- macro
- macros
- module_parameter_get
- module_parameters
- module_parameters=
Public Instance methods
append_dynamic_features( base, options )
[ source ]
Note: Is this the best name for this callback?
append_features(base)
[ source ]
attr_parameter( *opts )
[ source ]
Define an instance option method (via hash).
attr_parameters( meth, defaults={} )
[ source ]
Define a group of instance options via a hash.
extend(*args)
[ source ]
extend_dynamic_object( base, options )
[ source ]
Note: Is this the best name for this callback?
include(*args)
[ source ]
Alternate include which will store dynamic options.
This method is also aliased as
include_without_macros
include(*args)
[ source ]
Alias for include
local_parameters( defaults={} )
[ source ]
Define a group of local options via a hash.
macro( &blk )
[ source ]
macros()
[ source ]
module_parameter_get( mod, key )
[ source ]
Convenice method for looking up a parameter
module_parameters()
[ source ]
Store for dynamic module parameters. This is local per module and indexed on module/class included-into.
module_parameters=(x)
[ source ]