Class: SimpleNavigation::Adapters::Base

Inherits:
Object
  • Object
show all
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.

Direct Known Subclasses

Nanoc, Rails, Sinatra

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



8
9
10
# File 'lib/simple_navigation/adapters/base.rb', line 8

def context
  @context
end

#requestObject (readonly)

Returns the value of attribute request.



8
9
10
# File 'lib/simple_navigation/adapters/base.rb', line 8

def request
  @request
end

Class Method Details

.registerObject

This method is usually called when the framework is initialized. It should call SimpleNavigation.set_env and install SimpleNavigation::Helpers where appropriate.



13
# File 'lib/simple_navigation/adapters/base.rb', line 13

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.



34
# File 'lib/simple_navigation/adapters/base.rb', line 34

def (type, content, options = {}); end

#context_for_evalObject

Returns the context in which the config files will be evaluated



22
# File 'lib/simple_navigation/adapters/base.rb', line 22

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.

Returns:

  • (Boolean)


26
# File 'lib/simple_navigation/adapters/base.rb', line 26

def current_page?(url); end

Returns a link with the specified name, url and options. Used for rendering.



30
# File 'lib/simple_navigation/adapters/base.rb', line 30

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

#request_pathObject

Returns the path without query params



19
# File 'lib/simple_navigation/adapters/base.rb', line 19

def request_path; end

#request_uriObject

Returns the full path incl. query params



16
# File 'lib/simple_navigation/adapters/base.rb', line 16

def request_uri; end