Class: Jsapi::Meta::Path
- Inherits:
-
Jsapi::Model::Base
- Object
- Jsapi::Model::Base
- Jsapi::Meta::Path
- Defined in:
- lib/jsapi/meta/path.rb
Overview
Specifies a path.
Instance Method Summary collapse
-
#add_parameter(name, keywords = {}) ⇒ Object
:nodoc:.
-
#description ⇒ Object
:attr: description The common description for all operations in this path.
-
#initialize(name, owner, keywords = {}) ⇒ Path
constructor
Creates a new path with the given name and owner.
-
#inspect(*attributes) ⇒ Object
:nodoc:.
-
#model ⇒ Object
:attr: model The model class used by default for all operations in this path.
-
#name ⇒ Object
:attr_reader: name The relative path as a Pathname.
-
#owner ⇒ Object
:attr_reader: owner.
-
#parameters ⇒ Object
:attr: parameters The parameters that apply to all operations in this path.
-
#request_body ⇒ Object
:attr: request_body The RequestBody object or reference used by default by all operations in this path.
-
#responses ⇒ Object
:attr: responses The responses that can be produced by all operations in this path.
-
#security_requirements ⇒ Object
:attr: security_requirements The security requirements that apply to all operations in this path.
-
#summary ⇒ Object
:attr: summary The summary that applies to all operations in this path.
-
#tags ⇒ Object
:attr: tags The tags that apply to all operations in this path.
Methods inherited from Jsapi::Model::Base
#==, #errors, model_name, #respond_to_missing?
Constructor Details
#initialize(name, owner, keywords = {}) ⇒ Path
Creates a new path with the given name and owner.
77 78 79 80 81 |
# File 'lib/jsapi/meta/path.rb', line 77 def initialize(name, owner, keywords = {}) @name = Pathname.from(name) @owner = owner super(keywords) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Jsapi::Model::Base
Instance Method Details
#add_parameter(name, keywords = {}) ⇒ Object
:nodoc:
83 84 85 86 87 88 |
# File 'lib/jsapi/meta/path.rb', line 83 def add_parameter(name, keywords = {}) # :nodoc: try_modify_attribute!(:parameters) do name = name.to_s (@parameters ||= {})[name] = Parameter.new(name, keywords) end end |
#description ⇒ Object
:attr: description The common description for all operations in this path.
Applies to OpenAPI 3.0 and higher.
12 |
# File 'lib/jsapi/meta/path.rb', line 12 attribute :description, String |
#inspect(*attributes) ⇒ Object
:nodoc:
90 91 92 |
# File 'lib/jsapi/meta/path.rb', line 90 def inspect(*attributes) # :nodoc: super(*(attributes.presence || self.class.attribute_names).without(:owner)) end |
#model ⇒ Object
:attr: model The model class used by default for all operations in this path.
17 |
# File 'lib/jsapi/meta/path.rb', line 17 attribute :model, Class |
#name ⇒ Object
:attr_reader: name The relative path as a Pathname.
22 |
# File 'lib/jsapi/meta/path.rb', line 22 attribute :name, Pathname, accessors: i[reader] |
#owner ⇒ Object
:attr_reader: owner
26 |
# File 'lib/jsapi/meta/path.rb', line 26 attribute :owner, accessors: i[reader] |
#parameters ⇒ Object
:attr: parameters The parameters that apply to all operations in this path. Maps parameter names to Parameter objects or references.
32 |
# File 'lib/jsapi/meta/path.rb', line 32 attribute :parameters, { String => Parameter }, accessors: i[reader writer] |
#request_body ⇒ Object
:attr: request_body The RequestBody object or reference used by default by all operations in this path.
38 |
# File 'lib/jsapi/meta/path.rb', line 38 attribute :request_body, RequestBody |
#responses ⇒ Object
:attr: responses The responses that can be produced by all operations in this path. Maps instances of Status::Base to Response objects or references.
44 |
# File 'lib/jsapi/meta/path.rb', line 44 attribute :responses, { Status => Response }, default_key: Status::DEFAULT |
#security_requirements ⇒ Object
:attr: security_requirements The security requirements that apply to all operations in this path.
See SecurityRequirement for further information.
51 |
# File 'lib/jsapi/meta/path.rb', line 51 attribute :security_requirements, [SecurityRequirement], default: :nil |
#summary ⇒ Object
:attr: summary The summary that applies to all operations in this path.
Applies to OpenAPI 3.0 and higher.
69 |
# File 'lib/jsapi/meta/path.rb', line 69 attribute :summary, String |
#tags ⇒ Object
:attr: tags The tags that apply to all operations in this path.
74 |
# File 'lib/jsapi/meta/path.rb', line 74 attribute :tags, [String] |