Class: Compound::Part

Inherits:
Object
  • Object
show all
Defined in:
lib/compound/part.rb

Instance Method Summary collapse

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