Class: Migajas::Trail::Crumb
- Inherits:
-
Object
- Object
- Migajas::Trail::Crumb
- Defined in:
- lib/migajas.rb
Overview
Crumbs are dumb values that know their #name, their #url, and whether they match the current URL (according to the ‘env`, which they inherit from their trail).
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #current? ⇒ Boolean
-
#initialize(name, url, env) ⇒ Crumb
constructor
A new instance of Crumb.
Constructor Details
#initialize(name, url, env) ⇒ Crumb
Returns a new instance of Crumb.
71 72 73 74 75 |
# File 'lib/migajas.rb', line 71 def initialize(name, url, env) @name = name @url = url @env = env end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
69 70 71 |
# File 'lib/migajas.rb', line 69 def name @name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
69 70 71 |
# File 'lib/migajas.rb', line 69 def url @url end |
Instance Method Details
#current? ⇒ Boolean
77 78 79 |
# File 'lib/migajas.rb', line 77 def current? url == (@env["SCRIPT_NAME"] + @env["PATH_INFO"]) end |