Sha256: 91584461467e931dfee194273abac90df8d86adbd4556141715c4751c86dc4e4

Contents?: true

Size: 551 Bytes

Versions: 7

Compression:

Stored size: 551 Bytes

Contents

module SoberSwag
  module Reporting
    module Input
      ##
      # Resolve circular references by deferring the loading of an input.
      class Defer < Base
        def initialize(other_lazy)
          @other_lazy = other_lazy
        end

        attr_reader :other_lazy

        def other
          return @other if defined?(@other)

          @other = other_lazy.call
        end

        def call(input)
          other.call(input)
        end

        def swagger_schema
          other.swagger_schema
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sober_swag-0.25.2 lib/sober_swag/reporting/input/defer.rb
sober_swag-0.25.1 lib/sober_swag/reporting/input/defer.rb
sober_swag-0.25.0 lib/sober_swag/reporting/input/defer.rb
sober_swag-0.24.1 lib/sober_swag/reporting/input/defer.rb
sober_swag-0.24.0 lib/sober_swag/reporting/input/defer.rb
sober_swag-0.23.0 lib/sober_swag/reporting/input/defer.rb
sober_swag-0.22.0 lib/sober_swag/reporting/input/defer.rb