Sha256: 5604caa9aba5842aad5d79add27b03346ece1b7c641342497cb968cca2544a2a

Contents?: true

Size: 448 Bytes

Versions: 12

Compression:

Stored size: 448 Bytes

Contents

module OpenApi
  # https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#referenceObject
  class Reference
    prepend EquatableAsContent

    attr_accessor :ref

    def initialize(ref:)
      self.ref = ref
    end

    def serializable_hash
      {
        "$ref" => ref.to_s,
      }
    end

    def self.load(hash)
      return unless hash
      return unless hash["$ref"]

      new(ref: hash["$ref"])
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
open_api-0.6.2 lib/open_api/reference.rb
open_api-0.6.1 lib/open_api/reference.rb
open_api-0.6.0 lib/open_api/reference.rb
open_api-0.5.0 lib/open_api/reference.rb
open_api-0.4.0 lib/open_api/reference.rb
open_api-0.3.4 lib/open_api/reference.rb
open_api-0.3.3 lib/open_api/reference.rb
open_api-0.3.2 lib/open_api/reference.rb
open_api-0.3.1 lib/open_api/reference.rb
open_api-0.3.0 lib/open_api/reference.rb
open_api-0.2.0 lib/open_api/reference.rb
open_api-0.1.0 lib/open_api/reference.rb