class DotkaM::Player

Public Instance Methods

abandoned?() click to toggle source
# File lib/dotka/player.rb, line 45
def abandoned?
        @raw["leaver_status"].to_i == 1
end
account_id() click to toggle source
# File lib/dotka/player.rb, line 10
def account_id
        @raw["account_id"].to_i
end
assists() click to toggle source
# File lib/dotka/player.rb, line 41
def assists
        @raw["assists"].to_i
end
deaths() click to toggle source
# File lib/dotka/player.rb, line 37
def deaths
        @raw["deaths"].to_i
end
denies() click to toggle source
# File lib/dotka/player.rb, line 61
def denies
        @raw["denies"].to_i
end
gold() click to toggle source
# File lib/dotka/player.rb, line 53
def gold
        @raw["gold"].to_i + @raw["gold_spent"].to_i
end
gold_per_min() click to toggle source
# File lib/dotka/player.rb, line 65
def gold_per_min
        @raw["gold_per_min"].to_i
end
hero() click to toggle source
# File lib/dotka/player.rb, line 14
def hero
        Hero.new Storage.new.get("heroes", {"id" => @raw["hero_id"]})
end
hero_dmg() click to toggle source
# File lib/dotka/player.rb, line 73
def hero_dmg
        @raw["hero_damage"].to_i
end
hero_heal() click to toggle source
# File lib/dotka/player.rb, line 81
def hero_heal
        @raw["hero_healing"].to_i
end
items() click to toggle source
# File lib/dotka/player.rb, line 18
def items

        storage = Storage.new

        [
                Item.new(storage.get "items", {"id" => @raw["item_0"]}),
                Item.new(storage.get "items", {"id" => @raw["item_1"]}),
                Item.new(storage.get "items", {"id" => @raw["item_2"]}),
                Item.new(storage.get "items", {"id" => @raw["item_3"]}),
                Item.new(storage.get "items", {"id" => @raw["item_4"]}),
                Item.new(storage.get "items", {"id" => @raw["item_5"]})
        ]

end
kills() click to toggle source
# File lib/dotka/player.rb, line 33
def kills
        @raw["kills"].to_i
end
last_hits() click to toggle source
# File lib/dotka/player.rb, line 57
def last_hits
        @raw["last_hits"].to_i
end
level() click to toggle source
# File lib/dotka/player.rb, line 85
def level
        @raw["level"].to_i
end
team() click to toggle source
# File lib/dotka/player.rb, line 49
def team
        @raw["player_slot"].to_i > 4 ? "dire" : "radiant"
end
tower_dmg() click to toggle source
# File lib/dotka/player.rb, line 77
def tower_dmg
        @raw["tower_damage"].to_i
end
xp_per_min() click to toggle source
# File lib/dotka/player.rb, line 69
def xp_per_min
        @raw["xp_per_min"].to_i
end