Module: Transproc

Defined in:
lib/transproc.rb,
lib/transproc/hash.rb,
lib/transproc/array.rb,
lib/transproc/version.rb,
lib/transproc/composer.rb,
lib/transproc/function.rb,
lib/transproc/coercions.rb

Defined Under Namespace

Modules: Composer Classes: Function

Constant Summary collapse

VERSION =
"0.1.1".freeze
TRUE_VALUES =
[true, 1, '1', 'on', 't', 'true', 'y', 'yes'].freeze
FALSE_VALUES =
[false, 0, '0', 'off', 'f', 'false', 'n', 'no'].freeze
BOOLEAN_MAP =
Hash[
  TRUE_VALUES.product([true]) + FALSE_VALUES.product([false])
].freeze

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object



15
16
17
# File 'lib/transproc.rb', line 15

def self.[](name)
  functions.fetch(name)
end

.functionsObject



11
12
13
# File 'lib/transproc.rb', line 11

def self.functions
  @_functions ||= {}
end

.register(*args, &block) ⇒ Object



6
7
8
9
# File 'lib/transproc.rb', line 6

def self.register(*args, &block)
  name, fn = *args
  functions[name] = fn || block
end