Class: Swagger::V2::Path
Constant Summary
collapse
- VERBS =
[:get, :put, :post, :delete, :options, :head, :patch]
Instance Attribute Summary
#parent
Instance Method Summary
collapse
required_section, section
Methods included from Attachable
#attach_parent, #attach_to_children, #root
Constructor Details
#initialize(hash) ⇒ Path
Returns a new instance of Path.
17
18
19
20
|
# File 'lib/swagger/v2/path.rb', line 17
def initialize(hash)
hash[:parameters] ||= []
super
end
|
Instance Method Details
#operations ⇒ Object
22
23
24
25
26
27
|
# File 'lib/swagger/v2/path.rb', line 22
def operations
VERBS.each_with_object({}) do | v, h |
operation = send v
h[v] = operation if operation
end
end
|
#path ⇒ Object
33
34
35
|
# File 'lib/swagger/v2/path.rb', line 33
def path
parent.paths.key self
end
|
#uri_template ⇒ Object
29
30
31
|
# File 'lib/swagger/v2/path.rb', line 29
def uri_template
"#{parent.host}#{parent.base_path}#{path}"
end
|