Class: Google::Apis::GamesV1::PlayerAchievement

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/games_v1/classes.rb,
lib/google/apis/games_v1/representations.rb,
lib/google/apis/games_v1/representations.rb

Overview

An achievement object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ PlayerAchievement

Returns a new instance of PlayerAchievement.



1928
1929
1930
# File 'lib/google/apis/games_v1/classes.rb', line 1928

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#achievement_stateString

The state of the achievement. Corresponds to the JSON property achievementState

Returns:

  • (String)


1893
1894
1895
# File 'lib/google/apis/games_v1/classes.rb', line 1893

def achievement_state
  @achievement_state
end

#current_stepsFixnum

The current steps for an incremental achievement. Corresponds to the JSON property currentSteps

Returns:

  • (Fixnum)


1898
1899
1900
# File 'lib/google/apis/games_v1/classes.rb', line 1898

def current_steps
  @current_steps
end

#experience_pointsFixnum

Experience points earned for the achievement. This field is absent for achievements that have not yet been unlocked and 0 for achievements that have been unlocked by testers but that are unpublished. Corresponds to the JSON property experiencePoints

Returns:

  • (Fixnum)


1905
1906
1907
# File 'lib/google/apis/games_v1/classes.rb', line 1905

def experience_points
  @experience_points
end

#formatted_current_steps_stringString

The current steps for an incremental achievement as a string. Corresponds to the JSON property formattedCurrentStepsString

Returns:

  • (String)


1910
1911
1912
# File 'lib/google/apis/games_v1/classes.rb', line 1910

def formatted_current_steps_string
  @formatted_current_steps_string
end

#idString

The ID of the achievement. Corresponds to the JSON property id

Returns:

  • (String)


1915
1916
1917
# File 'lib/google/apis/games_v1/classes.rb', line 1915

def id
  @id
end

#kindString

Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievement. Corresponds to the JSON property kind

Returns:

  • (String)


1921
1922
1923
# File 'lib/google/apis/games_v1/classes.rb', line 1921

def kind
  @kind
end

#last_updated_timestampFixnum

The timestamp of the last modification to this achievement's state. Corresponds to the JSON property lastUpdatedTimestamp

Returns:

  • (Fixnum)


1926
1927
1928
# File 'lib/google/apis/games_v1/classes.rb', line 1926

def last_updated_timestamp
  @last_updated_timestamp
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1933
1934
1935
1936
1937
1938
1939
1940
1941
# File 'lib/google/apis/games_v1/classes.rb', line 1933

def update!(**args)
  @achievement_state = args[:achievement_state] if args.key?(:achievement_state)
  @current_steps = args[:current_steps] if args.key?(:current_steps)
  @experience_points = args[:experience_points] if args.key?(:experience_points)
  @formatted_current_steps_string = args[:formatted_current_steps_string] if args.key?(:formatted_current_steps_string)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @last_updated_timestamp = args[:last_updated_timestamp] if args.key?(:last_updated_timestamp)
end