lib/yukata/coercer.rb
# Registers a coercion with the yukata library
#
# @param origin [Class] the class to convert
# @param target [Class] what the origin will be converted to
Registers a coercion with the yukata library
Registers a coercion with the yukata library
def register(origin, target, &block)
      raise(ArgumentError, 'block is required') unless block_given?
      @mutex.synchronize do
        @coercions[origin][target] = Coercion.new(origin, target, &block)
      end
    end
def register ( origin , target , & block ) raise ( ArgumentError , 'block is required' ) unless block_given? @mutex . synchronize do @coercions [ origin ] [ target ] = Coercion . new ( origin , target , & block ) end end
Registers a coercion with the yukata library
Registers a coercion with the yukata library
origin
the class to convert
the class to convert
target
None
block
<not_specific>