Class: Starcraft2::Profile

Inherits:
Object
  • Object
show all
Defined in:
lib/starcraft2/profile.rb,
lib/starcraft2/profile/match.rb,
lib/starcraft2/profile/stats.rb,
lib/starcraft2/profile/career.rb,
lib/starcraft2/profile/ladder.rb,
lib/starcraft2/profile/points.rb,
lib/starcraft2/profile/season.rb,
lib/starcraft2/profile/ladders.rb,
lib/starcraft2/profile/rewards.rb,
lib/starcraft2/profile/campaign.rb,
lib/starcraft2/profile/non_rank.rb,
lib/starcraft2/profile/swarm_race.rb,
lib/starcraft2/profile/achievements.rb,
lib/starcraft2/profile/swarm_levels.rb,
lib/starcraft2/profile/detailed_season.rb,
lib/starcraft2/profile/achievement_item.rb

Defined Under Namespace

Classes: AchievementItem, Achievements, Campaign, Career, DetailedSeason, Ladder, Ladders, Match, NonRank, Points, Rewards, Season, Stats, SwarmLevels, SwarmRace

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Profile

Returns a new instance of Profile.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/starcraft2/profile.rb', line 6

def initialize(options = {})
  Utils.load(self, options, {
    :portrait => Icon,
    :campaign => Campaign,
    :career => Career,
    :swarm_levels => SwarmLevels,
    :season => Season,
    :rewards => Rewards,
    :achievements => Achievements
  })
end

Instance Attribute Details

#achievementsObject

Returns the value of attribute achievements.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def achievements
  @achievements
end

#campaignObject

Returns the value of attribute campaign.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def campaign
  @campaign
end

#careerObject

Returns the value of attribute career.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def career
  @career
end

#clan_nameObject

Returns the value of attribute clan_name.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def clan_name
  @clan_name
end

#clan_tagObject

Returns the value of attribute clan_tag.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def clan_tag
  @clan_tag
end

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def client
  @client
end

#display_nameObject

Returns the value of attribute display_name.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def display_name
  @display_name
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def id
  @id
end

#portraitObject

Returns the value of attribute portrait.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def portrait
  @portrait
end

#profile_pathObject

Returns the value of attribute profile_path.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def profile_path
  @profile_path
end

#realmObject

Returns the value of attribute realm.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def realm
  @realm
end

#rewardsObject

Returns the value of attribute rewards.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def rewards
  @rewards
end

#seasonObject

Returns the value of attribute season.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def season
  @season
end

#swarm_levelsObject

Returns the value of attribute swarm_levels.



3
4
5
# File 'lib/starcraft2/profile.rb', line 3

def swarm_levels
  @swarm_levels
end

Class Method Details

.build(client, data) ⇒ Object



18
19
20
# File 'lib/starcraft2/profile.rb', line 18

def self.build(client, data)
  new(data.merge!(:client => client))
end

Instance Method Details

#laddersObject



26
27
28
# File 'lib/starcraft2/profile.rb', line 26

def ladders
  client.send(:ladders, {:character_name => self.display_name, :id => self.id, :realm => self.realm})
end

#matchesObject



22
23
24
# File 'lib/starcraft2/profile.rb', line 22

def matches
  client.send(:matches, {:character_name => self.display_name, :id => self.id, :realm => self.realm})
end