Class: Goose::State
- Inherits:
-
Object
- Object
- Goose::State
- Defined in:
- lib/goose/state.rb
Instance Method Summary collapse
- #at?(place) ⇒ Boolean
- #breadcrumbs ⇒ Object
- #current_address ⇒ Object
-
#initialize(view) ⇒ State
constructor
A new instance of State.
- #render(nav, address) ⇒ Object
Constructor Details
#initialize(view) ⇒ State
Returns a new instance of State.
5 6 7 8 |
# File 'lib/goose/state.rb', line 5 def initialize(view) @view = view @stack ||= [] end |
Instance Method Details
#at?(place) ⇒ Boolean
14 15 16 |
# File 'lib/goose/state.rb', line 14 def at?(place) current_address.at?(place) end |
#breadcrumbs ⇒ Object
18 19 20 |
# File 'lib/goose/state.rb', line 18 def current_address. end |
#current_address ⇒ Object
22 23 24 |
# File 'lib/goose/state.rb', line 22 def current_address @stack.last end |
#render(nav, address) ⇒ Object
10 11 12 |
# File 'lib/goose/state.rb', line 10 def render(nav, address) at(nav, address) { @view.render(:partial => "nav/#{nav}") } end |