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 description that applies to all operations in this path.
-
#initialize(name, owner, keywords = {}) ⇒ Path
constructor
Creates a new path with the given name and owner.
-
#name ⇒ Object
:attr_reader: name The relative path as a Pathname.
-
#owner ⇒ Object
:attr_reader: owner.
-
#parameters ⇒ Object
:attr: parameters The Parameter objects applicable for all operations in this path.
-
#servers ⇒ Object
:attr: servers The Server objects that applies to all operations in this path.
-
#summary ⇒ Object
:attr: summary The summary that applies to all operations in this path.
Methods inherited from Jsapi::Model::Base
#==, #errors, #inspect, model_name, #respond_to_missing?
Constructor Details
#initialize(name, owner, keywords = {}) ⇒ Path
Creates a new path with the given name and owner.
40 41 42 43 44 |
# File 'lib/jsapi/meta/path.rb', line 40 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:
46 47 48 49 50 51 52 53 |
# File 'lib/jsapi/meta/path.rb', line 46 def add_parameter(name, keywords = {}) # :nodoc: name = name.to_s Parameter.new(name, keywords).tap do |parameter| (@parameters ||= {})[name] = parameter @owner.try(:invalidate_path_parameters, self.name) end end |
#description ⇒ Object
:attr: description The description that applies to all operations in this path. Applies to OpenAPI 3.0 and higher.
11 |
# File 'lib/jsapi/meta/path.rb', line 11 attribute :description, String |
#name ⇒ Object
:attr_reader: name The relative path as a Pathname.
16 |
# File 'lib/jsapi/meta/path.rb', line 16 attribute :name, Pathname, accessors: i[reader] |
#owner ⇒ Object
:attr_reader: owner
25 |
# File 'lib/jsapi/meta/path.rb', line 25 attribute :owner, accessors: i[reader] |
#parameters ⇒ Object
:attr: parameters The Parameter objects applicable for all operations in this path.
21 |
# File 'lib/jsapi/meta/path.rb', line 21 attribute :parameters, { String => Parameter }, accessors: i[reader writer] |
#servers ⇒ Object
:attr: servers The Server objects that applies to all operations in this path. Applies to OpenAPI 3.0 and higher.
37 |
# File 'lib/jsapi/meta/path.rb', line 37 attribute :servers, [Server] |
#summary ⇒ Object
:attr: summary The summary that applies to all operations in this path. Applies to OpenAPI 3.0 and higher.
31 |
# File 'lib/jsapi/meta/path.rb', line 31 attribute :summary, String |