class Swaggard::Swagger::Path
Attributes
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/swaggard/swagger/path.rb, line 8 def initialize(path) @path = path @operations = {} end
Public Instance Methods
add_operation(operation)
click to toggle source
# File lib/swaggard/swagger/path.rb, line 13 def add_operation(operation) @operations[operation.http_method.downcase] = operation end
ignore_put_if_patch!()
click to toggle source
# File lib/swaggard/swagger/path.rb, line 17 def ignore_put_if_patch! @operations.delete('put') if @operations.key?('patch') end
to_doc()
click to toggle source
# File lib/swaggard/swagger/path.rb, line 21 def to_doc Hash[@operations.map { |http_method, operation| [http_method, operation.to_doc] }] end