Class: RbSnake::App

Inherits:
Object
  • Object
show all
Defined in:
lib/rb_snake/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApp

Returns a new instance of App.



10
11
12
# File 'lib/rb_snake/app.rb', line 10

def initialize
  @state = Models::State.initial_state
end

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



8
9
10
# File 'lib/rb_snake/app.rb', line 8

def state
  @state
end

#windowObject (readonly)

Returns the value of attribute window.



8
9
10
# File 'lib/rb_snake/app.rb', line 8

def window
  @window
end

Instance Method Details

#startObject



14
15
16
17
# File 'lib/rb_snake/app.rb', line 14

def start
  @window = Views::Window.new
  window.start(state)
end