Method: Nandi::Config#register_method

Defined in:
lib/nandi/config.rb

#register_method(name, klass) ⇒ Object

Register a custom DDL method.

Parameters:

  • name (Symbol)

    The name of the method to create. This will be monkey-patched into Nandi::Migration.

  • klass (Class)

    The class to initialise with the arguments to the method. It should define a ‘template` instance method which will return a subclass of Cell::ViewModel from the Cells templating library and a `procedure` method that returns the name of the method. It may optionally define a `mixins` method, which will return an array of `Module`s to be mixed into any migration that uses this method.



118
119
120
# File 'lib/nandi/config.rb', line 118

def register_method(name, klass)
  custom_methods[name] = klass
end