Class: LeagueOfLegends::DTO::League
- Defined in:
- lib/league_of_legends/dto/league.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#participant_id ⇒ Object
readonly
Returns the value of attribute participant_id.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json) ⇒ League
constructor
A new instance of League.
Constructor Details
#initialize(json) ⇒ League
Returns a new instance of League.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/league_of_legends/dto/league.rb', line 13 def initialize json if json.is_a? String attributes = build_attributes json else attributes = json return if attributes.nil? end @entries = attributes[:entries].map do |entry| ::LeagueOfLegends::DTO::LeagueItem.new(entry) end @name = attributes[:name] @participant_id = attributes[:participantId] @queue = attributes[:queue] @tier = attributes[:tier] end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
11 12 13 |
# File 'lib/league_of_legends/dto/league.rb', line 11 def entries @entries end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/league_of_legends/dto/league.rb', line 11 def name @name end |
#participant_id ⇒ Object (readonly)
Returns the value of attribute participant_id.
11 12 13 |
# File 'lib/league_of_legends/dto/league.rb', line 11 def participant_id @participant_id end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
11 12 13 |
# File 'lib/league_of_legends/dto/league.rb', line 11 def queue @queue end |
#tier ⇒ Object (readonly)
Returns the value of attribute tier.
11 12 13 |
# File 'lib/league_of_legends/dto/league.rb', line 11 def tier @tier end |
Class Method Details
.version ⇒ Object
7 8 9 |
# File 'lib/league_of_legends/dto/league.rb', line 7 def self.version 'v2.3' end |