Class: Warcraft::Character::AchievementEvent
- Inherits:
-
Object
- Object
- Warcraft::Character::AchievementEvent
- Defined in:
- lib/warcraft/character/achievements.rb
Instance Method Summary collapse
- #achievement_id ⇒ Integer
- #achievement_name ⇒ String
- #achievement_url ⇒ String
-
#initialize(client, data) ⇒ AchievementEvent
constructor
A new instance of AchievementEvent.
- #time ⇒ Time
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_id ⇒ Integer
153 154 155 |
# File 'lib/warcraft/character/achievements.rb', line 153 def achievement_id @data.dig(:achievement, :id) end |
#achievement_name ⇒ String
148 149 150 |
# File 'lib/warcraft/character/achievements.rb', line 148 def achievement_name @data.dig(:achievement, :name) end |
#achievement_url ⇒ String
143 144 145 |
# File 'lib/warcraft/character/achievements.rb', line 143 def achievement_url @data.dig(:achievement, :key, :href) end |
#time ⇒ Time
158 159 160 |
# File 'lib/warcraft/character/achievements.rb', line 158 def time ApiResponse.convert_time(@data[:timestamp]) end |