Class: SimpleNavigation::Adapters::Padrino

Inherits:
Sinatra
  • Object
show all
Defined in:
lib/simple_navigation/adapters/padrino.rb

Instance Attribute Summary

Attributes inherited from Base

#context, #request

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Sinatra

#context_for_eval, #current_page?, #initialize, #request_path, #request_uri

Methods inherited from Base

#context_for_eval, #current_page?, #request_path, #request_uri

Constructor Details

This class inherits a constructor from SimpleNavigation::Adapters::Sinatra

Class Method Details

.register(app) ⇒ Object



4
5
6
7
# File 'lib/simple_navigation/adapters/padrino.rb', line 4

def self.register(app)
  SimpleNavigation.set_env(::Padrino.root, ::Padrino.env)
  ::Padrino::Application.send(:helpers, SimpleNavigation::Helpers)
end

Instance Method Details

#content_tag(type, content, options = {}) ⇒ Object



13
14
15
# File 'lib/simple_navigation/adapters/padrino.rb', line 13

def (type, content, options = {})
  context.(type, content.html_safe, options)
end


9
10
11
# File 'lib/simple_navigation/adapters/padrino.rb', line 9

def link_to(name, url, options = {})
  context.link_to(name, url, options)
end