Class: Sc2RanksApi::Team
- Inherits:
-
Object
- Object
- Sc2RanksApi::Team
- Defined in:
- lib/sc2ranksapi/team.rb
Instance Attribute Summary collapse
-
#division ⇒ Object
readonly
Returns the value of attribute division.
-
#division_rank ⇒ Object
readonly
Returns the value of attribute division_rank.
-
#favorite_race ⇒ Object
readonly
Returns the value of attribute favorite_race.
-
#league ⇒ Object
readonly
Returns the value of attribute league.
-
#losses ⇒ Object
readonly
Returns the value of attribute losses.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
-
#region_rank ⇒ Object
readonly
Returns the value of attribute region_rank.
-
#wins ⇒ Object
readonly
Returns the value of attribute wins.
-
#world_rank ⇒ Object
readonly
Returns the value of attribute world_rank.
Instance Method Summary collapse
-
#initialize(data) ⇒ Team
constructor
A new instance of Team.
- #ratio ⇒ Object
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
#division ⇒ Object (readonly)
Returns the value of attribute division.
3 4 5 |
# File 'lib/sc2ranksapi/team.rb', line 3 def division @division end |
#division_rank ⇒ Object (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_race ⇒ Object (readonly)
Returns the value of attribute favorite_race.
3 4 5 |
# File 'lib/sc2ranksapi/team.rb', line 3 def favorite_race @favorite_race end |
#league ⇒ Object (readonly)
Returns the value of attribute league.
3 4 5 |
# File 'lib/sc2ranksapi/team.rb', line 3 def league @league end |
#losses ⇒ Object (readonly)
Returns the value of attribute losses.
3 4 5 |
# File 'lib/sc2ranksapi/team.rb', line 3 def losses @losses end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
3 4 5 |
# File 'lib/sc2ranksapi/team.rb', line 3 def points @points end |
#region_rank ⇒ Object (readonly)
Returns the value of attribute region_rank.
3 4 5 |
# File 'lib/sc2ranksapi/team.rb', line 3 def region_rank @region_rank end |
#wins ⇒ Object (readonly)
Returns the value of attribute wins.
3 4 5 |
# File 'lib/sc2ranksapi/team.rb', line 3 def wins @wins end |
#world_rank ⇒ Object (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
#ratio ⇒ Object
17 18 19 |
# File 'lib/sc2ranksapi/team.rb', line 17 def ratio @wins/(@wins + @losses) end |