Class: Compound::Part
- Inherits:
-
Object
- Object
- Compound::Part
- Defined in:
- lib/compound/part.rb
Instance Method Summary collapse
-
#initialize(parent, mod) ⇒ Part
constructor
A new instance of Part.
- #method_missing(sym, *args, &block) ⇒ Object
Constructor Details
#initialize(parent, mod) ⇒ Part
Returns a new instance of Part.
9 10 11 12 13 14 |
# File 'lib/compound/part.rb', line 9 def initialize parent, mod @_compound_component_parent = parent @_compound_component_module = mod extend mod compounded(parent) if mod.instance_methods.include? :compounded end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
5 6 7 |
# File 'lib/compound/part.rb', line 5 def method_missing sym, *args, &block @_compound_component_parent.send sym, *args, &block end |