Class: Contentful::Management::Validation

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/contentful/management/validation.rb

Overview

A ContentType’s validations schema

Instance Attribute Summary

Attributes included from Resource

#client, #default_locale, #properties, #raw_object, #request

Instance Method Summary collapse

Methods included from Resource

#array?, #destroy, #fields, #nested_locale_fields?, #resource?, #sys, #update

Instance Method Details

#typeSymbol

Returns type of validation

Returns:

  • (Symbol)


27
28
29
30
31
32
# File 'lib/contentful/management/validation.rb', line 27

def type
  properties.keys.reject { |key| key == :validations }.each do |type|
    value = send(Support.snakify(type))
    return type if !value.nil? && value
  end
end