Method: Viddler::ApiSpec.check_attributes

Defined in:
lib/viddler/api_spec.rb

.check_attributes(viddler_method, attributes) ⇒ Object


76
77
78
79
80
81
82
83
# File 'lib/viddler/api_spec.rb', line 76

def self.check_attributes(viddler_method, attributes)
  valid_attributes = viddler_method_to_const(viddler_method)
  required = valid_attributes[:required] || Array.new
  optional = valid_attributes[:optional] || Array.new
  
  attributes.assert_valid_keys(required + optional)
  attributes.assert_required_keys(required)
end