lib/surrealist/type_helper.rb
# Coerces value is it should be coerced
#
# @param [any] value value that will be coerced
# @param [Class] type class representing data type
#
# @return [any] coerced value
Coerces value is it should be coerced
Coerces value is it should be coerced
def coerce(value, type)
        return value unless dry_type?(type)
        return value if type.try(value).input == value
        type[value]
      end
def coerce ( value , type ) return value unless dry_type? ( type ) return value if type . try ( value ) . input == value type [ value ] end
Coerces value is it should be coerced
Coerces value is it should be coerced
None
any
value
<not_specific>
type
<not_specific>
<not_specific>
type class representing data type
type class representing data type