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
Constants included from Resource
Instance Attribute Summary
Attributes included from Resource
#client, #default_locale, #properties, #raw_object, #request
Instance Method Summary collapse
- #properties_to_hash ⇒ Object
-
#type ⇒ Object
Returns type of validation.
Methods included from Resource
#array?, #fields, #initialize, #inspect, #nested_locale_fields?, #sys
Instance Method Details
#properties_to_hash ⇒ Object
19 20 21 22 23 |
# File 'lib/contentful/management/validation.rb', line 19 def properties_to_hash properties.each_with_object({}) do |(key, value), results| results[key] = value if Field.value_exists?(value) end end |
#type ⇒ Object
Returns type of validation
26 27 28 29 30 |
# File 'lib/contentful/management/validation.rb', line 26 def type properties.keys.each do |type| return type if !self.send(Support.snakify(type)).nil? end end |