Sha256: b2b95fd08a47a7ad00c6c3b9daedd8aaad39867efb372fa6588e07ef5701fab0
Contents?: true
Size: 925 Bytes
Versions: 10
Compression:
Stored size: 925 Bytes
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 :present, :boolean property :regexp, :hash property :linkContentType, :array property :range, :hash property :linkMimetypeGroup, :string property :linkField, :boolean # @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
10 entries across 10 versions & 1 rubygems