Class: Definition::Enroller

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

Instance Method Summary collapse

Constructor Details

#initialize(defn, table) ⇒ Enroller

Returns a new instance of Enroller.



19
20
21
22
# File 'lib/definition.rb', line 19

def initialize(defn, table)
  @defn = defn
  @table = table
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



23
24
25
26
27
# File 'lib/definition.rb', line 23

def method_missing(name, *args)
  @defn.set(args)
  @table[name] ||= []
  @table[name] << @defn
end