Class: SoberSwag::Reporting::Input::Defer
- Defined in:
- lib/sober_swag/reporting/input/defer.rb
Overview
Resolve circular references by deferring the loading of an input.
Instance Attribute Summary collapse
-
#other_lazy ⇒ Object
readonly
Returns the value of attribute other_lazy.
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize(other_lazy) ⇒ Defer
constructor
A new instance of Defer.
- #other ⇒ Object
- #swagger_schema ⇒ Object
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_lazy ⇒ Object (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 |
#other ⇒ Object
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_schema ⇒ Object
23 24 25 |
# File 'lib/sober_swag/reporting/input/defer.rb', line 23 def swagger_schema other.swagger_schema end |