Class: Mountapi::OpenApi::Path
- Inherits:
-
Object
- Object
- Mountapi::OpenApi::Path
- Defined in:
- lib/mountapi/open_api/path.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(path, spec, version) ⇒ Path
constructor
A new instance of Path.
- #operations ⇒ Object
- #to_routes ⇒ Object
Constructor Details
#initialize(path, spec, version) ⇒ Path
Returns a new instance of Path.
8 9 10 11 12 |
# File 'lib/mountapi/open_api/path.rb', line 8 def initialize(path, spec, version) @path = path @spec = spec @version = version end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/mountapi/open_api/path.rb', line 6 def path @path end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
6 7 8 |
# File 'lib/mountapi/open_api/path.rb', line 6 def spec @spec end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
6 7 8 |
# File 'lib/mountapi/open_api/path.rb', line 6 def version @version end |
Instance Method Details
#operations ⇒ Object
14 15 16 17 18 |
# File 'lib/mountapi/open_api/path.rb', line 14 def operations operation_nodes.inject([]) do |ops, op| ops.push(Operation.new(*op, path, version)) end end |
#to_routes ⇒ Object
20 21 22 |
# File 'lib/mountapi/open_api/path.rb', line 20 def to_routes operations.map(&:to_route) end |