class Daedal::Attributes::DistanceUnit

Constants

ALLOWED_DISTANCE_UNITS

Public Instance Methods

coerce(value) click to toggle source
# File lib/daedal/attributes/distance_unit.rb, line 6
def coerce(value)
  if value.nil? or !ALLOWED_DISTANCE_UNITS.include? value.to_s
    raise Virtus::CoercionError.new(value, 'Daedal::Attributes::DistanceUnit')
  end

  value.to_s
end