class Magiq::Types::CategoryDepth

Public Instance Methods

cast!() click to toggle source
# File lib/magiq/types.rb, line 130
def cast!
  v = raw.to_s.to_i

  if v >= 0 && v <= 2
    v
  else
    bad! "provided value of #{raw.inspect} is not a permitted category " \
    "depth, it must be an integer value of 0, 1, or 2."
  end
end