Class: SC2League

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

Constant Summary collapse

LEAGUES =
["no league", "bronze", "silver", "gold", "platinum", "diamond", "master", "grand master"]

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ SC2League

Returns a new instance of SC2League.



8
9
10
11
12
13
14
15
# File 'lib/sc2stats.rb', line 8

def initialize(name)
	index = LEAGUES.index(name)

	if not index.nil?
		@index = index
		@name = name
	end
end

Instance Method Details

#leaguesObject



19
20
21
# File 'lib/sc2stats.rb', line 19

def leagues
	@leagues
end

#to_sObject



23
24
25
# File 'lib/sc2stats.rb', line 23

def to_s
	@name.capitalize
end