Class: Goose::State
- Inherits:
-
Object
- Object
- Goose::State
- Defined in:
- lib/goose/state.rb
Instance Method Summary collapse
- #at?(place) ⇒ Boolean
-
#initialize(view) ⇒ State
constructor
A new instance of State.
- #render(nav, place) ⇒ 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) @stack.last == place end |
#render(nav, place) ⇒ Object
10 11 12 |
# File 'lib/goose/state.rb', line 10 def render(nav, place) at(nav, place) { @view.render(:partial => "nav/#{nav}") } end |