Module: Mariner

Defined in:
lib/mariner.rb,
lib/mariner/url.rb,
lib/mariner/store.rb,
lib/mariner/errors.rb,
lib/mariner/helper.rb,
lib/mariner/railtie.rb,
lib/mariner/version.rb,
lib/mariner/renderer/base.rb,
lib/mariner/unordered_list_renderer.rb

Defined Under Namespace

Modules: Errors, Helper, Renderer Classes: Railtie, Store, UnorderedListRenderer, Url

Constant Summary collapse

VERSION =
"0.0.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



18
19
20
# File 'lib/mariner.rb', line 18

def configuration
  @configuration
end

.rendering_strategiesObject

Returns the value of attribute rendering_strategies.



18
19
20
# File 'lib/mariner.rb', line 18

def rendering_strategies
  @rendering_strategies
end

Class Method Details

.configure(&block) ⇒ Object

Public: The public interface to navigation API

Examples:

Mariner.configure do
  an_arbitrary_group do
    root_path "Go Home"                                     #=> where `root_path` is a Rails route helper
    users_path "Manage Users", { "data-name" => "go-home" } #=> note the optional attributes hash. This
                                                            #   is used by rendering strategies
  end
end


37
38
39
40
# File 'lib/mariner.rb', line 37

def self.configure(&block)
  self.configuration ||= Store.new.tap { |s| s.virtual = true }
  self.configuration.instance_eval &block
end

.include_helperObject



42
43
44
45
46
47
# File 'lib/mariner.rb', line 42

def self.include_helper
  ActiveSupport.on_load(:action_controller) do
    include Mariner::Helper
    helper_method :render_navigation #:notest:
  end
end