Sha256: a42f0817744f8bd574f5b733f2ce0c4c601055c7389a1989889ea365ca25af44

Contents?: true

Size: 968 Bytes

Versions: 4

Compression:

Stored size: 968 Bytes

Contents

module QuakeliveApi
  class Profile
    attr_accessor :player_name

    def initialize(player_name)
      @player_name = player_name
    end

    def summary
      @summary ||= Summary.new(player_name)
    end

    def statistics
      @statistics ||= Statistics.new(player_name)
    end

    def awards_milestones
      @awards_milestones ||= Awards::CareerMilestones.new(player_name)
    end

    def awards_experience
      @awards_experience ||= Awards::Experience.new(player_name)
    end

    def awards_skillz
      @awards_skillz ||= Awards::MadSkillz.new(player_name)
    end

    def awards_social
      @awards_social ||= Awards::SocialLife.new(player_name)
    end

    def awards_success
      @awards_success ||= Awards::SweetSuccess.new(player_name)
    end

    def each_award(&block)
      %w(awards_milestones awards_experience awards_skillz awards_social awards_success).each do |awards|
        block.call(send(awards))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
quakelive_api-0.1.2 lib/quakelive_api/profile.rb
quakelive_api-0.1.1 lib/quakelive_api/profile.rb
quakelive_api-0.1.0 lib/quakelive_api/profile.rb
quakelive_api-0.0.1 lib/quakelive_api/profile.rb