Sha256: 5b187c8a7d7baa745f9db2463373985ae388aa66d672f9b5f0c3e5c79f778084
Contents?: true
Size: 1.01 KB
Versions: 16
Compression:
Stored size: 1.01 KB
Contents
require_relative 'resource' module Contentful module Management # A ContentType's validations schema class Validation include Contentful::Management::Resource property :in, :array property :size, :hash property :range, :hash property :regexp, :hash property :unique, :boolean property :present, :boolean property :linkField, :boolean property :assetFileSize, :hash property :linkContentType, :array property :linkMimetypeGroup, :string property :assetImageDimensions, :hash # @private def properties_to_hash properties.each_with_object({}) do |(key, value), results| results[key] = value if Field.value_exists?(value) end end # Returns type of validation # @return [Symbol] def type properties.keys.reject { |key| key == :validations }.each do |type| value = send(Support.snakify(type)) return type if !value.nil? && value end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems