Class: Paramix::Parametric::Mixin

Inherits:
Module
  • Object
show all
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)

Constructor Details

- (Mixin) initialize(base, parameters)

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

- (Object) private(name, &code)



104
105
106
107
# File 'lib/paramix.rb', line 104

def private(name, &code)
  define_method(name, &code)
  super(name)
end

- (Object) protected(name, &code)



110
111
112
113
# File 'lib/paramix.rb', line 110

def protected(name, &code)
  define_method(name, &code)
  super(name)
end

- (Object) public(name, &code)



98
99
100
101
# File 'lib/paramix.rb', line 98

def public(name, &code)
  define_method(name, &code)
  super(name)
end