Class: LeagueOfLegends::DTO::League

Inherits:
Base
  • Object
show all
Defined in:
lib/league_of_legends/dto/league.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#entriesObject (readonly)

Returns the value of attribute entries.



11
12
13
# File 'lib/league_of_legends/dto/league.rb', line 11

def entries
  @entries
end

#nameObject (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_idObject (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

#queueObject (readonly)

Returns the value of attribute queue.



11
12
13
# File 'lib/league_of_legends/dto/league.rb', line 11

def queue
  @queue
end

#tierObject (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

.versionObject



7
8
9
# File 'lib/league_of_legends/dto/league.rb', line 7

def self.version
  'v2.3'
end