Class: OasGrape::OasRouteBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/oas_grape/oas_route_builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(grape_route) ⇒ OasRouteBuilder

Returns a new instance of OasRouteBuilder.



9
10
11
# File 'lib/oas_grape/oas_route_builder.rb', line 9

def initialize(grape_route)
  @grape_route = grape_route
end

Class Method Details

.build_from_grape_route(grape_route) ⇒ Object



5
6
7
# File 'lib/oas_grape/oas_route_builder.rb', line 5

def self.build_from_grape_route(grape_route)
  new(grape_route).build
end

Instance Method Details

#buildObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/oas_grape/oas_route_builder.rb', line 13

def build
  OasCore::OasRoute.new(
    controller: controller,
    method_name: method_name,
    verb: verb,
    path: path,
    docstring: docstring,
    source_string: source_string,
    tags: tags
  )
end