Class: OpenapiRuby::Components::Loader
- Inherits:
-
Object
- Object
- OpenapiRuby::Components::Loader
- Defined in:
- lib/openapi_ruby/components/loader.rb
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
- #callbacks ⇒ Object
- #examples ⇒ Object
- #headers ⇒ Object
-
#initialize(paths: nil, scope: nil) ⇒ Loader
constructor
A new instance of Loader.
- #links ⇒ Object
- #load! ⇒ Object
- #parameters ⇒ Object
- #request_bodies ⇒ Object
- #responses ⇒ Object
- #schemas ⇒ Object
- #security_schemes ⇒ Object
- #to_openapi_hash ⇒ Object
Constructor Details
#initialize(paths: nil, scope: nil) ⇒ Loader
Returns a new instance of Loader.
8 9 10 11 |
# File 'lib/openapi_ruby/components/loader.rb', line 8 def initialize(paths: nil, scope: nil) @paths = paths || OpenapiRuby.configuration.component_paths @scope = scope&.to_sym end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
6 7 8 |
# File 'lib/openapi_ruby/components/loader.rb', line 6 def paths @paths end |
Instance Method Details
#callbacks ⇒ Object
58 59 60 |
# File 'lib/openapi_ruby/components/loader.rb', line 58 def callbacks filter_type(:callbacks) end |
#examples ⇒ Object
50 51 52 |
# File 'lib/openapi_ruby/components/loader.rb', line 50 def examples filter_type(:examples) end |
#headers ⇒ Object
46 47 48 |
# File 'lib/openapi_ruby/components/loader.rb', line 46 def headers filter_type(:headers) end |
#links ⇒ Object
54 55 56 |
# File 'lib/openapi_ruby/components/loader.rb', line 54 def links filter_type(:links) end |
#load! ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/openapi_ruby/components/loader.rb', line 13 def load! warn_about_autoloaded_paths! define_namespace_modules! load_component_files! @@loaded = true # rubocop:disable Style/ClassVars self end |
#parameters ⇒ Object
30 31 32 |
# File 'lib/openapi_ruby/components/loader.rb', line 30 def parameters filter_type(:parameters) end |
#request_bodies ⇒ Object
38 39 40 |
# File 'lib/openapi_ruby/components/loader.rb', line 38 def request_bodies filter_type(:requestBodies) end |
#responses ⇒ Object
42 43 44 |
# File 'lib/openapi_ruby/components/loader.rb', line 42 def responses filter_type(:responses) end |
#schemas ⇒ Object
26 27 28 |
# File 'lib/openapi_ruby/components/loader.rb', line 26 def schemas filter_type(:schemas) end |
#security_schemes ⇒ Object
34 35 36 |
# File 'lib/openapi_ruby/components/loader.rb', line 34 def security_schemes filter_type(:securitySchemes) end |
#to_openapi_hash ⇒ Object
21 22 23 24 |
# File 'lib/openapi_ruby/components/loader.rb', line 21 def to_openapi_hash ensure_loaded! Registry.instance.to_openapi_hash(scope: @scope) end |