Sha256: 63ef0454aa7096d818aa253564e706de49a1477a7041aff714695b216b26cad9

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

module Lurker
  module Json
    class Parser
      module Expertise
        module_function

        def type_defined?(hash)
          return false unless hash.is_a?(Hash)

          hash.key?(Json::TYPE) && Json::PRIMITIVES.include?(hash[Json::TYPE])
        end

        def type_supposed?(hash)
          return false unless hash.is_a?(Hash)

          hash.key?(Json::ANYOF) || hash.key?(Json::ALLOF) || hash.key?(Json::ONEOF) ||
          hash.key?(Json::ITEMS) || hash.key?(Json::PROPERTIES) ||
          hash.key?(Json::REF)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lurker-0.6.4 lib/lurker/json/parser/expertise.rb