Sha256: 9341cd4a4be269903ae2dfc483de0bf8c83a3e8127c358c015fe0b7de9d2dcb5

Contents?: true

Size: 1.47 KB

Versions: 5

Compression:

Stored size: 1.47 KB

Contents

require 'lol/model'

module Lol
  class MatchSummary < Lol::Model
    # @!attribute [r] assists
    #   @return [Fixnum] Number of assists
    attr_reader :assists

    # @!attribute [r] date
    #   @return [Time] Match date
    attr_reader :date

    # @!attribute [r] deaths
    #   @return [Fixnum] Number of deaths
    attr_reader :deaths

    # @!attribute [r] game_id
    #   @return [Fixnum] Game Id
    attr_reader :game_id

    # @!attribute [r] game_mode
    #   @return [String] Game Mode
    attr_reader :game_mode

    # @!attribute [r] invalid
    #   @return [true] If the match is invalid
    #   @return [false] If the match is valid
    attr_reader :invalid

    # @!attribute [r] kills
    #   @return [Fixnum] Number of kills
    attr_reader :kills

    # @!attribute [r] map_id
    #   @return [Fixnum] Map Id
    attr_reader :map_id

    # @!attribute [r] opposing_team_kills
    #   @return [Fixnum] Opposing Team Kills
    attr_reader :opposing_team_kills

    # @!attribute [r] opposing_team_name
    #   @return [String] Opposing Team Name
    attr_reader :opposing_team_name

    # @!attribute [r] win
    #   @return [true] If the team won this match
    #   @return [false] If the team lost this match
    attr_reader :win

    private

    attr_writer :assists, :deaths, :game_id, :game_mode, :invalid, :kills, :map_id, :opposing_team_kills, :opposing_team_name, :win

    def date= value
      @date = value.is_a?(Numeric) && Time.at(value / 1000) || value
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby-lol-0.9.4 lib/lol/match_summary.rb
ruby-lol-0.9.3 lib/lol/match_summary.rb
ruby-lol-0.9.1 lib/lol/match_summary.rb
ruby-lol-0.0.7 lib/lol/match_summary.rb
ruby-lol-0.0.6 lib/lol/match_summary.rb