Class: Deckstrings::Hero
- Inherits:
-
Object
- Object
- Deckstrings::Hero
- Defined in:
- lib/deckstrings/deckstrings.rb
Overview
A Hearthstone hero with basic metadata.
Instance Attribute Summary collapse
-
#hero_class ⇒ HeroClass
readonly
Class of the hero.
-
#id ⇒ Integer
readonly
Hearthstone DBF ID of the hero.
-
#name ⇒ String
readonly
Name of the hero.
Class Method Summary collapse
-
.alleria ⇒ Hero
Alleria Windrunner.
-
.anduin ⇒ Hero
Anduin Wrynn.
-
.arthas ⇒ Hero
Prince Arthas.
-
.druid ⇒ Hero
Malfurion Stormrage.
-
.from_id(id) ⇒ Hero
Hero corresponding to DBF ID.
-
.garrosh ⇒ Hero
Garrosh Hellscream.
-
.guldan ⇒ Hero
Gul'dan.
-
.hunter ⇒ Hero
Rexxar.
-
.jaina ⇒ Hero
Jaina Proudmoore.
-
.khadgar ⇒ Hero
Khadgar.
-
.liadrin ⇒ Hero
Lady Liadrin.
-
.lunara ⇒ Hero
Lunara.
-
.mage ⇒ Hero
Jaina Proudmoore.
-
.magni ⇒ Hero
Magni Bronzebeard.
-
.maiev ⇒ Hero
Maiev Shadowsong.
-
.malfurion ⇒ Hero
Malfurion Stormrage.
-
.mecha_jaraxxus ⇒ Hero
Mecha-Jaraxxus.
-
.morgl ⇒ Hero
Morgl the Oracle.
-
.nemsy ⇒ Hero
Nemsy Necrofizzle.
-
.paladin ⇒ Hero
Uther Lightbringer.
-
.priest ⇒ Hero
Anduin Wrynn.
-
.rexxar ⇒ Hero
Rexxar.
-
.rogue ⇒ Hero
Valeera Sanguinar.
-
.shaman ⇒ Hero
Thrall.
-
.thrall ⇒ Hero
Thrall.
-
.tyrande ⇒ Hero
Tyrande Whisperwind.
-
.uther ⇒ Hero
Uther Lightbringer.
-
.valeera ⇒ Hero
Valeera Sanguinar.
-
.warlock ⇒ Hero
Gul'dan.
-
.warrior ⇒ Hero
Garrosh Hellscream.
Instance Method Summary collapse
-
#initialize(id, name, hero_class) ⇒ Hero
constructor
A new instance of Hero.
Constructor Details
#initialize(id, name, hero_class) ⇒ Hero
Returns a new instance of Hero.
90 91 92 93 94 95 |
# File 'lib/deckstrings/deckstrings.rb', line 90 def initialize(id, name, hero_class) @id = id @name = name @hero_class = HeroClass.parse(hero_class) raise ArgumentError, "Invalid hero class: #{hero_class}." if @hero_class.nil? end |
Instance Attribute Details
#hero_class ⇒ HeroClass (readonly)
Returns Class of the hero.
257 258 259 |
# File 'lib/deckstrings/deckstrings.rb', line 257 def hero_class @hero_class end |
#id ⇒ Integer (readonly)
Returns Hearthstone DBF ID of the hero.
251 252 253 |
# File 'lib/deckstrings/deckstrings.rb', line 251 def id @id end |
#name ⇒ String (readonly)
Returns Name of the hero.
254 255 256 |
# File 'lib/deckstrings/deckstrings.rb', line 254 def name @name end |
Class Method Details
.alleria ⇒ Hero
Returns Alleria Windrunner.
183 184 185 |
# File 'lib/deckstrings/deckstrings.rb', line 183 def self.alleria self.from_id(2826) end |
.anduin ⇒ Hero
Returns Anduin Wrynn.
163 164 165 |
# File 'lib/deckstrings/deckstrings.rb', line 163 def self.anduin self.from_id(813) end |
.arthas ⇒ Hero
Returns Prince Arthas.
223 224 225 |
# File 'lib/deckstrings/deckstrings.rb', line 223 def self.arthas self.from_id(46116) end |
.druid ⇒ Hero
Returns Malfurion Stormrage.
128 129 130 |
# File 'lib/deckstrings/deckstrings.rb', line 128 def self.druid self.malfurion end |
.from_id(id) ⇒ Hero
Returns Hero corresponding to DBF ID.
244 245 246 247 |
# File 'lib/deckstrings/deckstrings.rb', line 244 def self.from_id(id) hero = Database.instance.heroes[id] Hero.new(id, hero['name'], hero['class']) end |
.garrosh ⇒ Hero
Returns Garrosh Hellscream.
233 234 235 |
# File 'lib/deckstrings/deckstrings.rb', line 233 def self.garrosh self.from_id(7) end |
.guldan ⇒ Hero
Returns Gul'dan.
193 194 195 |
# File 'lib/deckstrings/deckstrings.rb', line 193 def self.guldan self.from_id(893) end |
.hunter ⇒ Hero
Returns Rexxar.
173 174 175 |
# File 'lib/deckstrings/deckstrings.rb', line 173 def self.hunter self.rexxar end |
.jaina ⇒ Hero
Returns Jaina Proudmoore.
103 104 105 |
# File 'lib/deckstrings/deckstrings.rb', line 103 def self.jaina self.from_id(637) end |
.khadgar ⇒ Hero
Returns Khadgar.
108 109 110 |
# File 'lib/deckstrings/deckstrings.rb', line 108 def self.khadgar self.from_id(39117) end |
.liadrin ⇒ Hero
Returns Lady Liadrin.
218 219 220 |
# File 'lib/deckstrings/deckstrings.rb', line 218 def self.liadrin self.from_id(2827) end |
.lunara ⇒ Hero
Returns Lunara.
138 139 140 |
# File 'lib/deckstrings/deckstrings.rb', line 138 def self.lunara self.from_id(50484) end |
.mage ⇒ Hero
Returns Jaina Proudmoore.
98 99 100 |
# File 'lib/deckstrings/deckstrings.rb', line 98 def self.mage self.jaina end |
.magni ⇒ Hero
Returns Magni Bronzebeard.
238 239 240 |
# File 'lib/deckstrings/deckstrings.rb', line 238 def self.magni self.from_id(2828) end |
.maiev ⇒ Hero
Returns Maiev Shadowsong.
123 124 125 |
# File 'lib/deckstrings/deckstrings.rb', line 123 def self.maiev self.from_id(40195) end |
.malfurion ⇒ Hero
Returns Malfurion Stormrage.
133 134 135 |
# File 'lib/deckstrings/deckstrings.rb', line 133 def self.malfurion self.from_id(274) end |
.mecha_jaraxxus ⇒ Hero
Returns Mecha-Jaraxxus.
203 204 205 |
# File 'lib/deckstrings/deckstrings.rb', line 203 def self.mecha_jaraxxus self.from_id(51834) end |
.morgl ⇒ Hero
Returns Morgl the Oracle.
153 154 155 |
# File 'lib/deckstrings/deckstrings.rb', line 153 def self.morgl self.from_id(40183) end |
.nemsy ⇒ Hero
Returns Nemsy Necrofizzle.
198 199 200 |
# File 'lib/deckstrings/deckstrings.rb', line 198 def self.nemsy self.from_id(47817) end |
.paladin ⇒ Hero
Returns Uther Lightbringer.
208 209 210 |
# File 'lib/deckstrings/deckstrings.rb', line 208 def self.paladin self.uther end |
.priest ⇒ Hero
Returns Anduin Wrynn.
158 159 160 |
# File 'lib/deckstrings/deckstrings.rb', line 158 def self.priest self.anduin end |
.rexxar ⇒ Hero
Returns Rexxar.
178 179 180 |
# File 'lib/deckstrings/deckstrings.rb', line 178 def self.rexxar self.from_id(31) end |
.rogue ⇒ Hero
Returns Valeera Sanguinar.
113 114 115 |
# File 'lib/deckstrings/deckstrings.rb', line 113 def self.rogue self.valeera end |
.shaman ⇒ Hero
Returns Thrall.
143 144 145 |
# File 'lib/deckstrings/deckstrings.rb', line 143 def self.shaman self.thrall end |
.thrall ⇒ Hero
Returns Thrall.
148 149 150 |
# File 'lib/deckstrings/deckstrings.rb', line 148 def self.thrall self.from_id(1066) end |
.tyrande ⇒ Hero
Returns Tyrande Whisperwind.
168 169 170 |
# File 'lib/deckstrings/deckstrings.rb', line 168 def self.tyrande self.from_id(41887) end |
.uther ⇒ Hero
Returns Uther Lightbringer.
213 214 215 |
# File 'lib/deckstrings/deckstrings.rb', line 213 def self.uther self.from_id(671) end |
.valeera ⇒ Hero
Returns Valeera Sanguinar.
118 119 120 |
# File 'lib/deckstrings/deckstrings.rb', line 118 def self.valeera self.from_id(930) end |
.warlock ⇒ Hero
Returns Gul'dan.
188 189 190 |
# File 'lib/deckstrings/deckstrings.rb', line 188 def self.warlock self.guldan end |
.warrior ⇒ Hero
Returns Garrosh Hellscream.
228 229 230 |
# File 'lib/deckstrings/deckstrings.rb', line 228 def self.warrior self.garrosh end |