Class: Japic::Rank
- Inherits:
-
Object
- Object
- Japic::Rank
- Defined in:
- lib/japic/rank.rb
Constant Summary collapse
- RANK_DATA_TYPES =
%w( order team points gp win draw lost gf ga gd ).map(&:freeze).freeze
Instance Method Summary collapse
-
#initialize(response_data) ⇒ Rank
constructor
A new instance of Rank.
Constructor Details
#initialize(response_data) ⇒ Rank
Returns a new instance of Rank.
18 19 20 21 22 23 24 25 |
# File 'lib/japic/rank.rb', line 18 def initialize(response_data) # rename lank(rank's typo?) to order. @order = response_data.delete('lank') response_data.each do |k, v| instance_variable_set(:"@#{k}", v) if RANK_DATA_TYPES.include?(k) end end |