Class: Paramix::Parametric::Mixin
- Inherits:
-
Module
- Object
- Module
- Paramix::Parametric::Mixin
- Defined in:
- lib/paramix.rb
Overview
An instance of the Mixin module class is what is porduced when parameters are applied to a parametric module.
Instance Method Summary collapse
-
#initialize(base, parameters) ⇒ Mixin
constructor
A new instance of Mixin.
- #private(name, &code) ⇒ Object
- #protected(name, &code) ⇒ Object
- #public(name, &code) ⇒ Object
Constructor Details
#initialize(base, parameters) ⇒ Mixin
Returns a new instance of Mixin.
88 89 90 91 92 93 94 95 |
# File 'lib/paramix.rb', line 88 def initialize(base, parameters) include(base) #base.append_features(self) base.parameterized.each do |code| instance_exec(parameters, &code) end #base.parameterized.clear end |
Instance Method Details
#private(name, &code) ⇒ Object
104 105 106 107 |
# File 'lib/paramix.rb', line 104 def private(name, &code) define_method(name, &code) super(name) end |
#protected(name, &code) ⇒ Object
110 111 112 113 |
# File 'lib/paramix.rb', line 110 def protected(name, &code) define_method(name, &code) super(name) end |
#public(name, &code) ⇒ Object
98 99 100 101 |
# File 'lib/paramix.rb', line 98 def public(name, &code) define_method(name, &code) super(name) end |