Module: Transproc::Functions

Defined in:
lib/transproc/functions.rb

Overview

Function container extension

Examples:

module MyTransformations
  extend Transproc::Functions

  def boom!(value)
    "#{value} BOOM!"
  end
end

Transproc(:boom!)['w00t!'] # => "w00t! BOOM!"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mod) ⇒ Object



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

def self.extended(mod)
  warn 'Transproc::Functions is deprecated please switch to Transproc::Registry'
  super
end

Instance Method Details

#method_added(meth) ⇒ Object



24
25
26
27
# File 'lib/transproc/functions.rb', line 24

def method_added(meth)
  module_function meth
  Transproc.register(meth, method(meth))
end