class Daedal::Attributes::TypeValue

Constants

ALLOWED_QUERY_VALUE_CLASSES

Public Instance Methods

coerce(q) click to toggle source
# File lib/daedal/attributes/type_value.rb, line 7
def coerce(q)
  if !required? and q.nil?
    return q
  elsif ALLOWED_QUERY_VALUE_CLASSES.include? q.class
    return q
  else
    raise Virtus::CoercionError.new(q, self.class)
  end
end