Class: LeagueOfLegends::DTO::Team

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Team

Returns a new instance of Team.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/league_of_legends/dto/team.rb', line 11

def initialize attributes
  return if attributes.nil?

  @create_date = Time.at(attributes[:createDate]/1000)
  @full_id = attributes[:fullId]
  @last_game_date = Time.at(attributes[:lastGameDate]/1000)
  @last_join_date = Time.at(attributes[:lastJoinDate]/1000)
  @last_joined_ranked_team_queue_date = Time.at(attributes[:lastJoinedRankedTeamQueueDate]/1000)
  @match_history = attributes[:matchHistory].map do |match|
    ::LeagueOfLegends::DTO::MatchHistorySummary.new(match)
  end
  @message_of_day = ::LeagueOfLegends::DTO::MessageOfDay.new(attributes[:messageOfDay])
  @modify_date = Time.at(attributes[:modifyDate]/1000)
  @name = attributes[:name]
  @roster = ::LeagueOfLegends::DTO::Roster.new(attributes[:roster])
  @second_last_join_date = Time.at(attributes[:secondLastJoinDate]/1000)
  @status = attributes[:status]
  @tag = attributes[:tag]
  @team_stat_summary = ::LeagueOfLegends::DTO::TeamStatSummary.new(attributes[:teamStatSummary])
  @third_last_join_date = Time.at(attributes[:thirdLastJoinDate]/1000)
end

Instance Attribute Details

#create_dateObject (readonly)

Returns the value of attribute create_date.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def create_date
  @create_date
end

#full_idObject (readonly)

Returns the value of attribute full_id.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def full_id
  @full_id
end

#last_game_dateObject (readonly)

Returns the value of attribute last_game_date.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def last_game_date
  @last_game_date
end

#last_join_dateObject (readonly)

Returns the value of attribute last_join_date.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def last_join_date
  @last_join_date
end

#last_joined_ranked_team_queue_dateObject (readonly)

Returns the value of attribute last_joined_ranked_team_queue_date.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def last_joined_ranked_team_queue_date
  @last_joined_ranked_team_queue_date
end

#match_historyObject (readonly)

Returns the value of attribute match_history.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def match_history
  @match_history
end

#message_of_dayObject (readonly)

Returns the value of attribute message_of_day.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def message_of_day
  @message_of_day
end

#modify_dateObject (readonly)

Returns the value of attribute modify_date.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def modify_date
  @modify_date
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def name
  @name
end

#rosterObject (readonly)

Returns the value of attribute roster.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def roster
  @roster
end

#second_last_join_dateObject (readonly)

Returns the value of attribute second_last_join_date.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def second_last_join_date
  @second_last_join_date
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def status
  @status
end

#tagObject (readonly)

Returns the value of attribute tag.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def tag
  @tag
end

#team_stat_summaryObject (readonly)

Returns the value of attribute team_stat_summary.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def team_stat_summary
  @team_stat_summary
end

#third_last_join_dateObject (readonly)

Returns the value of attribute third_last_join_date.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def third_last_join_date
  @third_last_join_date
end

#xObject (readonly)

Returns the value of attribute x.



9
10
11
# File 'lib/league_of_legends/dto/team.rb', line 9

def x
  @x
end

Class Method Details

.versionObject



5
6
7
# File 'lib/league_of_legends/dto/team.rb', line 5

def self.version
  'v2.2'
end