class XboxLiveApi::Achievement

Attributes

icon_url[R]

@return [String] the url for icon on xbox.com

id[R]

@return [Fixnum] a unique identifier

is_secret[R]

@return [Boolean] true if the achievement is secret

is_unlocked[R]

@return [Boolean] true if the achievement has been unlocked by the player

locked_description[R]

@return [String] the description to be used when the achievement is locked

name[R]

@return [String] the name of the achievement

time_unlocked[R]

@return [String] the date the achievement was unlocked. The formatting is dependent

on the actual xbox live api. Xbox 360 achievements have the form "2015-07-25T13:55:01.5300000Z".
Xbox one achievements have the form "2015-07-25T13:16:50.2887979Z".
unlocked_description[R]

@return [String] the description to be used when the achievement is unlocked

value[R]

@return [Fixnum] the gamescore value awarded for unlocking this achievement

Public Class Methods

new(name: nil, id: nil, is_unlocked: nil, icon_url: nil, is_secret: nil, unlocked_description: nil, locked_description: nil, value: nil, time_unlocked: nil) click to toggle source
# File lib/xbox_live_api/achievement.rb, line 25
def initialize(name: nil, id: nil, is_unlocked: nil, icon_url: nil, is_secret: nil,
               unlocked_description: nil, locked_description: nil, value: nil,
               time_unlocked: nil)
  @name = name
  @id = id
  @is_unlocked = is_unlocked
  @icon_url = icon_url
  @is_secret = is_secret
  @unlocked_description = unlocked_description
  @locked_description = locked_description
  @value = value
  @time_unlocked = time_unlocked
end

Public Instance Methods

==(o) click to toggle source
# File lib/xbox_live_api/achievement.rb, line 39
def ==(o)
  o.instance_of?(self.class) && o.state == state
end
hash() click to toggle source
# File lib/xbox_live_api/achievement.rb, line 43
def hash
  state.hash
end

Protected Instance Methods

state() click to toggle source
# File lib/xbox_live_api/achievement.rb, line 49
def state
  [@name, @id, @is_unlocked, @icon_url, @is_secret, @unlocked_description,
   @locked_description, @value, @time_unlocked]
end