Class: SwaggerParser::Path
Constant Summary
collapse
- OPERATION_NAMES =
%w(
delete
get
head
options
patch
post
put
)
Instance Attribute Summary
#source
Instance Method Summary
collapse
Methods included from Referable
#ref
Methods included from Extendable
#extensions
#initialize
Instance Method Details
22
23
24
25
26
|
# File 'lib/swagger_parser/path.rb', line 22
def delete
if source["delete"]
SwaggerParser::Operation.new(source["delete"], http_method: "DELETE")
end
end
|
29
30
31
32
33
|
# File 'lib/swagger_parser/path.rb', line 29
def get
if source["get"]
SwaggerParser::Operation.new(source["get"], http_method: "GET")
end
end
|
36
37
38
39
40
|
# File 'lib/swagger_parser/path.rb', line 36
def head
if source["head"]
SwaggerParser::Operation.new(source["head"], http_method: "HEAD")
end
end
|
43
44
45
46
47
|
# File 'lib/swagger_parser/path.rb', line 43
def operations
OPERATION_NAMES.map do |operation_name|
send(operation_name)
end.compact
end
|
50
51
52
53
54
|
# File 'lib/swagger_parser/path.rb', line 50
def options
if source["options"]
SwaggerParser::Operation.new(source["options"], http_method: "OPTIONS")
end
end
|
#parameters ⇒ Object
57
58
59
|
# File 'lib/swagger_parser/path.rb', line 57
def parameters
source["parameters"]
end
|
62
63
64
65
66
|
# File 'lib/swagger_parser/path.rb', line 62
def patch
if source["patch"]
SwaggerParser::Operation.new(source["patch"], http_method: "PATCH")
end
end
|
69
70
71
72
73
|
# File 'lib/swagger_parser/path.rb', line 69
def post
if source["post"]
SwaggerParser::Operation.new(source["post"], http_method: "POST")
end
end
|
76
77
78
79
80
|
# File 'lib/swagger_parser/path.rb', line 76
def put
if source["put"]
SwaggerParser::Operation.new(source["put"], http_method: "PUT")
end
end
|