class Contentful::Management::Validation

A ContentType’s validations schema

Constants

NON_TYPE_PROPERTIES

Properties not specific to a field type validation

Public Instance Methods

properties_to_hash() click to toggle source

@private

# File lib/contentful/management/validation.rb, line 31
def properties_to_hash
  properties.each_with_object({}) do |(key, value), results|
    results[key] = value if Field.value_exists?(value)
  end
end
type() click to toggle source

Returns type of validation @return [Symbol]

# 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