class Swagger::Grape::RoutePath
Attributes
scopes[R]
types[R]
Public Class Methods
new(route_name)
click to toggle source
# File lib/ruby-swagger/grape/route_path.rb, line 9 def initialize(route_name) @name = route_name @operations = {} @types = [] @scopes = [] end
Public Instance Methods
add_operation(route)
click to toggle source
# File lib/ruby-swagger/grape/route_path.rb, line 16 def add_operation(route) method = Swagger::Grape::Method.new(@name, route) grape_operation = method.operation @types = (@types | method.types).uniq @scopes = (@scopes | method.scopes).uniq @operations[route.route_method.downcase] = grape_operation end
to_swagger()
click to toggle source
# File lib/ruby-swagger/grape/route_path.rb, line 25 def to_swagger path = Swagger::Data::Path.new @operations.each do |operation_verb, operation| path.send("#{operation_verb}=", operation) end path end