Class: SoberSwag::Reporting::Input::Defer

Inherits:
Base
  • Object
show all
Defined in:
lib/sober_swag/reporting/input/defer.rb

Overview

Resolve circular references by deferring the loading of an input.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Interface

#add_schema_key, #call!, #described, #enum, #format, #in_range, #list, #mapped, #modify_schema, #multiple_of, #optional, #or, #referenced, #swagger_path_schema, #swagger_query_schema, #|

Constructor Details

#initialize(other_lazy) ⇒ Defer

Returns a new instance of Defer.



7
8
9
# File 'lib/sober_swag/reporting/input/defer.rb', line 7

def initialize(other_lazy)
  @other_lazy = other_lazy
end

Instance Attribute Details

#other_lazyObject (readonly)

Returns the value of attribute other_lazy.



11
12
13
# File 'lib/sober_swag/reporting/input/defer.rb', line 11

def other_lazy
  @other_lazy
end

Instance Method Details

#call(input) ⇒ Object



19
20
21
# File 'lib/sober_swag/reporting/input/defer.rb', line 19

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

#otherObject



13
14
15
16
17
# File 'lib/sober_swag/reporting/input/defer.rb', line 13

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

  @other = other_lazy.call
end

#swagger_schemaObject



23
24
25
# File 'lib/sober_swag/reporting/input/defer.rb', line 23

def swagger_schema
  other.swagger_schema
end