Class: SimpleNavigation::Adapters::Base
- Inherits:
-
Object
- Object
- SimpleNavigation::Adapters::Base
- Defined in:
- lib/simple_navigation/adapters/base.rb
Overview
This is the base class for all adapters. This class mainly exists for documenting reasons. It lists all the methods that an adapter should implement.
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Class Method Summary collapse
-
.register ⇒ Object
This method is usually called when the framework is initialized.
Instance Method Summary collapse
-
#content_tag(type, content, options = {}) ⇒ Object
Returns a tag of the specified type, content and options.
-
#context_for_eval ⇒ Object
Returns the context in which the config files will be evaluated.
-
#current_page?(url) ⇒ Boolean
Returns true if the current request’s url matches the specified url.
-
#link_to(name, url, options = {}) ⇒ Object
Returns a link with the specified name, url and options.
-
#request_path ⇒ Object
Returns the path without query params.
-
#request_uri ⇒ Object
Returns the full path incl.
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
10 11 12 |
# File 'lib/simple_navigation/adapters/base.rb', line 10 def context @context end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
10 11 12 |
# File 'lib/simple_navigation/adapters/base.rb', line 10 def request @request end |
Class Method Details
.register ⇒ Object
This method is usually called when the framework is initialized. It should call SimpleNavigation.set_env and install SimpleNavigation::Helpers where appropriate.
15 |
# File 'lib/simple_navigation/adapters/base.rb', line 15 def self.register; end |
Instance Method Details
#content_tag(type, content, options = {}) ⇒ Object
Returns a tag of the specified type, content and options. Used for rendering.
36 |
# File 'lib/simple_navigation/adapters/base.rb', line 36 def content_tag(type, content, = {}); end |
#context_for_eval ⇒ Object
Returns the context in which the config files will be evaluated
24 |
# File 'lib/simple_navigation/adapters/base.rb', line 24 def context_for_eval; end |
#current_page?(url) ⇒ Boolean
Returns true if the current request’s url matches the specified url. Used to determine if an item should be autohighlighted.
28 |
# File 'lib/simple_navigation/adapters/base.rb', line 28 def current_page?(url); end |
#link_to(name, url, options = {}) ⇒ Object
Returns a link with the specified name, url and options. Used for rendering.
32 |
# File 'lib/simple_navigation/adapters/base.rb', line 32 def link_to(name, url, = {}); end |
#request_path ⇒ Object
Returns the path without query params
21 |
# File 'lib/simple_navigation/adapters/base.rb', line 21 def request_path; end |
#request_uri ⇒ Object
Returns the full path incl. query params
18 |
# File 'lib/simple_navigation/adapters/base.rb', line 18 def request_uri; end |