Class: Goose::State

Inherits:
Object
  • Object
show all
Defined in:
lib/goose/state.rb

Instance Method Summary collapse

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

Returns:

  • (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