Class: PetfinderV2::Services::Option
- Inherits:
-
Object
- Object
- PetfinderV2::Services::Option
- Defined in:
- lib/petfinder_V2/services/option.rb
Instance Method Summary collapse
-
#initialize(klass, choices = []) ⇒ Option
constructor
A new instance of Option.
- #validate_value(value, key) ⇒ Object
Constructor Details
#initialize(klass, choices = []) ⇒ Option
Returns a new instance of Option.
4 5 6 7 |
# File 'lib/petfinder_V2/services/option.rb', line 4 def initialize(klass, choices = []) @klass = klass @choices = choices end |
Instance Method Details
#validate_value(value, key) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/petfinder_V2/services/option.rb', line 9 def validate_value(value, key) if value.respond_to?(:each) validate_collection_val(value, key) else validate_single_val(value, key) end end |