Class: RubyPtvApi::Model::XTour::GoalImportance
- Defined in:
- lib/ruby_ptv_api/model/x_tour/goal_importance.rb
Constant Summary collapse
- RANKING =
{ standard: 0, do_not_care: 1, important: 2, very_important: 3 }
Class Method Summary collapse
Class Method Details
.validate(value) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/ruby_ptv_api/model/x_tour/goal_importance.rb', line 34 def self.validate(value) value = RANKING[value] if value.is_a? Symbol unless RANKING.values.includes?(value) raise WrongParameterFormat.new("#{value} is not a valid must be in #{RANKING}. Both Symbol and Fixnum are allowed") end value end |