Class: OasHanami::RouteExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/oas_hanami/route_extractor.rb

Class Method Summary collapse

Class Method Details

.clean_route(route) ⇒ Object



14
15
16
# File 'lib/oas_hanami/route_extractor.rb', line 14

def clean_route(route)
  route.gsub("(.:format)", "").gsub(/:\w+/) { |match| "{#{match[1..]}}" }
end

.clear_cacheObject



10
11
12
# File 'lib/oas_hanami/route_extractor.rb', line 10

def clear_cache
  @host_routes = nil
end

.host_routesObject



6
7
8
# File 'lib/oas_hanami/route_extractor.rb', line 6

def host_routes
  @host_routes ||= extract_host_routes
end