Class: Warcraft::Character::AchievementEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/warcraft/character/achievements.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, data) ⇒ AchievementEvent

Returns a new instance of AchievementEvent.



137
138
139
140
# File 'lib/warcraft/character/achievements.rb', line 137

def initialize(client, data)
  @client = client
  @data = data
end

Instance Method Details

#achievement_idInteger

Returns:

  • (Integer)


153
154
155
# File 'lib/warcraft/character/achievements.rb', line 153

def achievement_id
  @data.dig(:achievement, :id)
end

#achievement_nameString

Returns:

  • (String)


148
149
150
# File 'lib/warcraft/character/achievements.rb', line 148

def achievement_name
  @data.dig(:achievement, :name)
end

#achievement_urlString

Returns:

  • (String)


143
144
145
# File 'lib/warcraft/character/achievements.rb', line 143

def achievement_url
  @data.dig(:achievement, :key, :href)
end

#timeTime

Returns:

  • (Time)


158
159
160
# File 'lib/warcraft/character/achievements.rb', line 158

def time
  ApiResponse.convert_time(@data[:timestamp])
end