Sha256: 1426b73796a50f035f5261fbf0d1c7a185d35020aa205ca231c96ff3135d105c

Contents?: true

Size: 534 Bytes

Versions: 8

Compression:

Stored size: 534 Bytes

Contents

require 'oas_objs/helpers'

module OpenApi
  module DSL
    # https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#referenceObject
    class RefObj < Hash
      include Helpers

      attr_accessor :processed
      def initialize(ref_to, component_key)
        self.processed = {
            '$ref': "#components/#{ref_to.to_s.pluralize}/#{component_key}"
        }
      end

      def process; processed; end
    end
  end
end


__END__

Reference Object Example

{
	"$ref": "#/components/schemas/Pet"
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zero-rails_openapi-1.5.2 lib/oas_objs/ref_obj.rb
zero-rails_openapi-1.5.1 lib/oas_objs/ref_obj.rb
zero-rails_openapi-1.4.3 lib/oas_objs/ref_obj.rb
zero-rails_openapi-1.4.2 lib/oas_objs/ref_obj.rb
zero-rails_openapi-1.4.1 lib/oas_objs/ref_obj.rb
zero-rails_openapi-1.4.0 lib/oas_objs/ref_obj.rb
zero-rails_openapi-1.3.3 lib/oas_objs/ref_obj.rb
zero-rails_openapi-1.3.2 lib/oas_objs/ref_obj.rb