class HappyMapper::SupportedTypes::NilOrAlreadyConverted

For the cases when the value is nil or is already the intended type then no work needs to be done and the value simply can be returned.

Public Instance Methods

apply(value) click to toggle source
# File lib/happymapper/supported_types.rb, line 92
def apply(value)
  value
end
apply?(value, convert_to_type) click to toggle source
# File lib/happymapper/supported_types.rb, line 88
def apply?(value, convert_to_type)
  value.is_a?(convert_to_type) || value.nil?
end
type() click to toggle source
# File lib/happymapper/supported_types.rb, line 84
def type
  NilClass
end