class Migajas::Trail

The Trail is just an `env`-aware Array, with some convenient sugar for adding items to it.

Public Class Methods

new(env) click to toggle source
Calls superclass method
# File lib/migajas.rb, line 60
def initialize(env)
  @env = env
  super()
end

Public Instance Methods

<<(name, url = @env["SCRIPT_NAME"])
Alias for: add
add(name, url = @env["SCRIPT_NAME"]) click to toggle source

Add a new crumb to this trail. This takes care of calculating the URL from the path currently matched by Cuba, so all you need to provide is the name.

Returns self.

# File lib/migajas.rb, line 70
def add(name, url = @env["SCRIPT_NAME"])
  push Crumb.new(name, url, @env)
end
Also aliased as: <<