module Smelter::Extendable

Public Class Methods

included(base) click to toggle source

Extendable classes must support the following methods def self.find_each

I.e. as with an ActiveRecord model

end

def id

returns the id of the script

end

def source

returns the source file for the script

end

# File lib/smelter/extendable.rb, line 17
def self.included(base)
  Smelter::DefinitionProxy.extension_class = base

  base.class_eval do
    extend ClassMethods
  end
end

Public Instance Methods

register() click to toggle source
# File lib/smelter/extendable.rb, line 25
def register
  instance_eval source, id, 1
end