Class: Sc2RanksApi::Team

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Team

Returns a new instance of Team.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/sc2ranksapi/team.rb', line 5

def initialize(data)
  @world_rank    = data["world_rank"]
  @region_rank   = data["region_rank"]
  @division_rank = data["division_rank"]
  @division      = data["division"]
  @league        = data["league"]
  @points        = data["points"]
  @wins          = data["wins"]
  @losses        = data["losses"]
  @favorite_race = data["favorite_race"]
end

Instance Attribute Details

#divisionObject (readonly)

Returns the value of attribute division.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def division
  @division
end

#division_rankObject (readonly)

Returns the value of attribute division_rank.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def division_rank
  @division_rank
end

#favorite_raceObject (readonly)

Returns the value of attribute favorite_race.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def favorite_race
  @favorite_race
end

#leagueObject (readonly)

Returns the value of attribute league.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def league
  @league
end

#lossesObject (readonly)

Returns the value of attribute losses.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def losses
  @losses
end

#pointsObject (readonly)

Returns the value of attribute points.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def points
  @points
end

#region_rankObject (readonly)

Returns the value of attribute region_rank.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def region_rank
  @region_rank
end

#winsObject (readonly)

Returns the value of attribute wins.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def wins
  @wins
end

#world_rankObject (readonly)

Returns the value of attribute world_rank.



3
4
5
# File 'lib/sc2ranksapi/team.rb', line 3

def world_rank
  @world_rank
end

Instance Method Details

#ratioObject



17
18
19
# File 'lib/sc2ranksapi/team.rb', line 17

def ratio
  @wins/(@wins + @losses)
end