Sha256: 3dd9077d7daa15306eb66cf3fd747c749ea51873aa3e4d5d3a8803ca48861dbd

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

require "openapi3_parser/node_factory/map"
require "openapi3_parser/node_factories/path_item"
require "openapi3_parser/nodes/callback"

module Openapi3Parser
  module NodeFactories
    class Callback
      include NodeFactory::Map

      private

      def process_input(input)
        input.each_with_object({}) do |(key, value), memo|
          memo[key] = value if extension?(key)
          memo[key] = NodeFactories::PathItem.new(context.next_namespace(key))
        end
      end

      def build_map(data, context)
        Nodes::Callback.new(data, context)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openapi3_parser-0.2.0 lib/openapi3_parser/node_factories/callback.rb
openapi3_parser-0.1.0 lib/openapi3_parser/node_factories/callback.rb