class Navigatrix::Item::State

Attributes

context[R]

Public Class Methods

new(config, context) click to toggle source
Calls superclass method
# File lib/navigatrix/item.rb, line 79
def initialize(config, context)
  @context = context
  super(config)
end

Public Instance Methods

action_matches?() click to toggle source
# File lib/navigatrix/item.rb, line 92
def action_matches?
  actions.empty? || actions.include?(action_name)
end
actions() click to toggle source
Calls superclass method
# File lib/navigatrix/item.rb, line 104
def actions
  Array.wrap(super)
end
applicable?() click to toggle source
# File lib/navigatrix/item.rb, line 84
def applicable?
  path ? path_matches? : (controller_matches? && action_matches?)
end
controller_matches?() click to toggle source
# File lib/navigatrix/item.rb, line 88
def controller_matches?
  match?(controller, controller_name)
end
match?(pattern, target) click to toggle source
# File lib/navigatrix/item.rb, line 100
def match?(pattern, target)
  pattern.is_a?(Regexp) ? target[pattern] : pattern == target
end
path_matches?() click to toggle source
# File lib/navigatrix/item.rb, line 96
def path_matches?
  match?(path, current_path)
end