Module: HoN

Defined in:
lib/hon/hon.rb,
lib/hon/hero.rb,
lib/hon/match.rb,
lib/hon/stats.rb,
lib/hon/player.rb

Defined Under Namespace

Classes: HeroError, HeroStats, MatchError, MatchStats, PlayerError, PlayerStats, Stats

Class Method Summary collapse

Class Method Details

.heroes(nickname) {|hero| ... } ⇒ Object

Yields:

  • (hero)


8
9
10
11
12
# File 'lib/hon/hon.rb', line 8

def self.heroes nickname
  hero = HeroStats.new nickname
  yield hero if block_given?
  hero
end

.match(id) {|match| ... } ⇒ Object

Yields:



20
21
22
23
24
# File 'lib/hon/hon.rb', line 20

def self.match id
  match = MatchStats.new id
  yield match if block_given?
  match
end

.player(nickname, *options) {|player| ... } ⇒ Object

Yields:



14
15
16
17
18
# File 'lib/hon/hon.rb', line 14

def self.player nickname, *options
  player = PlayerStats.new nickname, *options
  yield player if block_given?
  player
end