Class: Contentful::Management::Validation
- Inherits:
-
Object
- Object
- Contentful::Management::Validation
- Includes:
- Resource
- Defined in:
- lib/contentful/management/validation.rb
Overview
A ContentType’s validations schema
Constant Summary collapse
- NON_TYPE_PROPERTIES =
Properties not specific to a field type validation
%i[validations message].freeze
Instance Attribute Summary
Attributes included from Resource
#client, #properties, #raw_object, #request
Instance Method Summary collapse
-
#type ⇒ Symbol
Returns type of validation.
Methods included from Resource
#array?, #default_locale, #destroy, #environment_id, #fields, #nested_locale_fields?, #resource?, #save, #sys, #update
Instance Method Details
#type ⇒ Symbol
Returns type of validation
39 40 41 42 43 44 |
# File 'lib/contentful/management/validation.rb', line 39 def type properties.keys.reject { |key| NON_TYPE_PROPERTIES.include?(key) }.each do |type| value = send(Support.snakify(type)) return type if !value.nil? && value end end |