Object
Abstract coercer class
@api private
# File lib/virtus/coercer.rb, line 11 def initialize(type) @type = type @primitive = type.primitive end
Coerce input value into expected primitive type
@param [Object] input
@return [Object] coerced input
@api public
# File lib/virtus/coercer.rb, line 23 def call(input) NotImplementedError.new("#{self.class}#call must be implemented") end
Return if the input value was successfuly coerced
# File lib/virtus/coercer.rb, line 34 def success?(primitive, input) input.kind_of?(primitive) end
[Validate]
Generated with the Darkfish Rdoc Generator 2.