class Dentaku::AST::Duration::Value

def validate_unit(unit)

def validate_unit(unit)
  case unit.downcase
  when /years?/ then :year
  when /months?/ then :month
  when /days?/ then :day
  else
    raise Dentaku::ArgumentError.for(:incompatible_type, value: unit, for: Duration),
      "'#{unit || unit.class}' is not a valid duration unit"
  end
end