Class: Assumption::Game
- Inherits:
-
Object
- Object
- Assumption::Game
- Includes:
- UniFunctions
- Defined in:
- lib/assumption/game.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#chart_data_set ⇒ Object
readonly
Returns the value of attribute chart_data_set.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#input ⇒ Object
Returns the value of attribute input.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(year) ⇒ Game
constructor
A new instance of Game.
Methods included from UniFunctions
#clear_terminal, #get_char, #title, #underline
Constructor Details
#initialize(year) ⇒ Game
Returns a new instance of Game.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/assumption/game.rb', line 16 def initialize(year) @year = year @chart_data_set = Assumption::ChartDataSet.find_or_create_by_year(year) @level = 1 @@all << self @current_song = @chart_data_set.random @next_song = @chart_data_set.random @input = nil start_level end |
Instance Attribute Details
#chart_data_set ⇒ Object (readonly)
Returns the value of attribute chart_data_set.
14 15 16 |
# File 'lib/assumption/game.rb', line 14 def chart_data_set @chart_data_set end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'lib/assumption/game.rb', line 14 def id @id end |
#input ⇒ Object
Returns the value of attribute input.
12 13 14 |
# File 'lib/assumption/game.rb', line 12 def input @input end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
14 15 16 |
# File 'lib/assumption/game.rb', line 14 def year @year end |
Class Method Details
.all ⇒ Object
8 9 10 |
# File 'lib/assumption/game.rb', line 8 def self.all @@all end |