Class: HaloWaypoint::Player
- Defined in:
- lib/halo_waypoint/player.rb
Instance Attribute Summary collapse
-
#background_image_url ⇒ Object
readonly
Returns the value of attribute background_image_url.
-
#emblem_image_url ⇒ Object
readonly
Returns the value of attribute emblem_image_url.
-
#favorite_weapon_description ⇒ Object
readonly
Returns the value of attribute favorite_weapon_description.
-
#favorite_weapon_id ⇒ Object
readonly
Returns the value of attribute favorite_weapon_id.
-
#favorite_weapon_image_url ⇒ Object
readonly
Returns the value of attribute favorite_weapon_image_url.
-
#favorite_weapon_name ⇒ Object
readonly
Returns the value of attribute favorite_weapon_name.
-
#favorite_weapon_total_kills ⇒ Object
readonly
Returns the value of attribute favorite_weapon_total_kills.
-
#game_modes ⇒ Object
readonly
Returns the value of attribute game_modes.
-
#gamertag ⇒ Object
readonly
Returns the value of attribute gamertag.
-
#next_rank_id ⇒ Object
readonly
Returns the value of attribute next_rank_id.
-
#next_rank_image_url ⇒ Object
readonly
Returns the value of attribute next_rank_image_url.
-
#next_rank_name ⇒ Object
readonly
Returns the value of attribute next_rank_name.
-
#next_rank_start_xp ⇒ Object
readonly
Returns the value of attribute next_rank_start_xp.
-
#rank_id ⇒ Object
readonly
Returns the value of attribute rank_id.
-
#rank_image_url ⇒ Object
readonly
Returns the value of attribute rank_image_url.
-
#rank_name ⇒ Object
readonly
Returns the value of attribute rank_name.
-
#rank_start_xp ⇒ Object
readonly
Returns the value of attribute rank_start_xp.
-
#service_tag ⇒ Object
readonly
Returns the value of attribute service_tag.
-
#specializations ⇒ Object
readonly
Returns the value of attribute specializations.
-
#top_medals ⇒ Object
readonly
Returns the value of attribute top_medals.
-
#top_skill_rank ⇒ Object
readonly
Returns the value of attribute top_skill_rank.
-
#xp ⇒ Object
readonly
Returns the value of attribute xp.
Class Method Summary collapse
Methods inherited from Resource
#assign_attributes, #initialize, string_to_key
Constructor Details
This class inherits a constructor from HaloWaypoint::Resource
Instance Attribute Details
#background_image_url ⇒ Object (readonly)
Returns the value of attribute background_image_url.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def background_image_url @background_image_url end |
#emblem_image_url ⇒ Object (readonly)
Returns the value of attribute emblem_image_url.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def emblem_image_url @emblem_image_url end |
#favorite_weapon_description ⇒ Object (readonly)
Returns the value of attribute favorite_weapon_description.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def favorite_weapon_description @favorite_weapon_description end |
#favorite_weapon_id ⇒ Object (readonly)
Returns the value of attribute favorite_weapon_id.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def favorite_weapon_id @favorite_weapon_id end |
#favorite_weapon_image_url ⇒ Object (readonly)
Returns the value of attribute favorite_weapon_image_url.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def favorite_weapon_image_url @favorite_weapon_image_url end |
#favorite_weapon_name ⇒ Object (readonly)
Returns the value of attribute favorite_weapon_name.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def favorite_weapon_name @favorite_weapon_name end |
#favorite_weapon_total_kills ⇒ Object (readonly)
Returns the value of attribute favorite_weapon_total_kills.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def favorite_weapon_total_kills @favorite_weapon_total_kills end |
#game_modes ⇒ Object (readonly)
Returns the value of attribute game_modes.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def game_modes @game_modes end |
#gamertag ⇒ Object (readonly)
Returns the value of attribute gamertag.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def gamertag @gamertag end |
#next_rank_id ⇒ Object (readonly)
Returns the value of attribute next_rank_id.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def next_rank_id @next_rank_id end |
#next_rank_image_url ⇒ Object (readonly)
Returns the value of attribute next_rank_image_url.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def next_rank_image_url @next_rank_image_url end |
#next_rank_name ⇒ Object (readonly)
Returns the value of attribute next_rank_name.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def next_rank_name @next_rank_name end |
#next_rank_start_xp ⇒ Object (readonly)
Returns the value of attribute next_rank_start_xp.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def next_rank_start_xp @next_rank_start_xp end |
#rank_id ⇒ Object (readonly)
Returns the value of attribute rank_id.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def rank_id @rank_id end |
#rank_image_url ⇒ Object (readonly)
Returns the value of attribute rank_image_url.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def rank_image_url @rank_image_url end |
#rank_name ⇒ Object (readonly)
Returns the value of attribute rank_name.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def rank_name @rank_name end |
#rank_start_xp ⇒ Object (readonly)
Returns the value of attribute rank_start_xp.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def rank_start_xp @rank_start_xp end |
#service_tag ⇒ Object (readonly)
Returns the value of attribute service_tag.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def service_tag @service_tag end |
#specializations ⇒ Object (readonly)
Returns the value of attribute specializations.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def specializations @specializations end |
#top_medals ⇒ Object (readonly)
Returns the value of attribute top_medals.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def top_medals @top_medals end |
#top_skill_rank ⇒ Object (readonly)
Returns the value of attribute top_skill_rank.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def top_skill_rank @top_skill_rank end |
#xp ⇒ Object (readonly)
Returns the value of attribute xp.
3 4 5 |
# File 'lib/halo_waypoint/player.rb', line 3 def xp @xp end |
Class Method Details
.find(gamertag, game = 'h4') ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/halo_waypoint/player.rb', line 10 def find(gamertag, game = 'h4') response = HaloWaypoint.get(URI.escape("/en-us/players/#{gamertag}/#{game}/playercard")) data = response.parsed_response if data['PlayerCardResponse'] && data['PlayerCardResponse']['StatusCode'] == '1' new(data['PlayerCardResponse']) else raise 'Player Not Found' end end |