Class: SimpleNavigation::Adapters::Sinatra

Inherits:
Base
  • Object
show all
Defined in:
lib/simple-navigation/adapters/sinatra-middleman.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.middleman_app=(app) ⇒ Object



4
5
6
# File 'lib/simple-navigation/adapters/sinatra-middleman.rb', line 4

def self.middleman_app=(app)
  @@middleman_app = app
end

Instance Method Details

#request_uriObject

Our request doesn’t have a fullpath, so we must return path instead.



9
10
11
12
# File 'lib/simple-navigation/adapters/sinatra-middleman.rb', line 9

def request_uri
  @prefix ||= @@middleman_app.nil? ? '/' : @@middleman_app.inst.http_prefix
  @prefix + request.path
end