Class: Gitlab::GrapeOpenapi::Models::PathItem
- Inherits:
-
Object
- Object
- Gitlab::GrapeOpenapi::Models::PathItem
- Defined in:
- lib/gitlab/grape_openapi/models/path_item.rb
Instance Attribute Summary collapse
- #operations ⇒ Object readonly
Instance Method Summary collapse
- #add_operation(method, operation) ⇒ Object
-
#initialize ⇒ PathItem
constructor
A new instance of PathItem.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ PathItem
Returns a new instance of PathItem.
10 11 12 |
# File 'lib/gitlab/grape_openapi/models/path_item.rb', line 10 def initialize @operations = {} end |
Instance Attribute Details
#operations ⇒ Object (readonly)
8 9 10 |
# File 'lib/gitlab/grape_openapi/models/path_item.rb', line 8 def operations @operations end |
Instance Method Details
#add_operation(method, operation) ⇒ Object
14 15 16 17 18 |
# File 'lib/gitlab/grape_openapi/models/path_item.rb', line 14 def add_operation(method, operation) return if operation.hidden? @operations[method.to_s.downcase] = operation end |
#to_h ⇒ Object
20 21 22 |
# File 'lib/gitlab/grape_openapi/models/path_item.rb', line 20 def to_h operations.transform_values(&:to_h) end |