Class: GodvilleKit::Hero
- Inherits:
-
Object
- Object
- GodvilleKit::Hero
- Defined in:
- lib/godville_kit/hero.rb
Instance Attribute Summary collapse
-
#accumulator ⇒ Object
readonly
Returns the value of attribute accumulator.
-
#alignment ⇒ Object
readonly
Returns the value of attribute alignment.
-
#approximate_age ⇒ Object
readonly
Returns the value of attribute approximate_age.
-
#arena_losses ⇒ Object
readonly
Returns the value of attribute arena_losses.
-
#arena_wins ⇒ Object
readonly
Returns the value of attribute arena_wins.
-
#ark ⇒ Object
readonly
Returns the value of attribute ark.
-
#ark_completed_at ⇒ Object
readonly
Returns the value of attribute ark_completed_at.
-
#aura_name ⇒ Object
readonly
Returns the value of attribute aura_name.
-
#aura_time ⇒ Object
readonly
Returns the value of attribute aura_time.
-
#birthday ⇒ Object
readonly
Returns the value of attribute birthday.
-
#bricks ⇒ Object
readonly
Returns the value of attribute bricks.
-
#deaths ⇒ Object
readonly
Returns the value of attribute deaths.
-
#diary ⇒ Object
readonly
Returns the value of attribute diary.
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#equipment ⇒ Object
readonly
Returns the value of attribute equipment.
-
#exp_progress ⇒ Object
readonly
Returns the value of attribute exp_progress.
-
#god_name ⇒ Object
readonly
Returns the value of attribute god_name.
-
#god_power ⇒ Object
readonly
Returns the value of attribute god_power.
-
#gold ⇒ Object
readonly
Returns the value of attribute gold.
-
#guild ⇒ Object
readonly
Returns the value of attribute guild.
-
#guild_rank ⇒ Object
readonly
Returns the value of attribute guild_rank.
-
#health ⇒ Object
readonly
Returns the value of attribute health.
-
#inventory ⇒ Object
readonly
Returns the value of attribute inventory.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#max_health ⇒ Object
readonly
Returns the value of attribute max_health.
-
#max_inventory ⇒ Object
readonly
Returns the value of attribute max_inventory.
-
#monster_name ⇒ Object
readonly
Returns the value of attribute monster_name.
-
#monster_progress ⇒ Object
readonly
Returns the value of attribute monster_progress.
-
#monsters_killed ⇒ Object
readonly
Returns the value of attribute monsters_killed.
-
#motto ⇒ Object
readonly
Returns the value of attribute motto.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#next_town ⇒ Object
readonly
Returns the value of attribute next_town.
-
#pantheons ⇒ Object
readonly
Returns the value of attribute pantheons.
-
#quest ⇒ Object
readonly
Returns the value of attribute quest.
-
#quest_progress ⇒ Object
readonly
Returns the value of attribute quest_progress.
-
#quests_completed ⇒ Object
readonly
Returns the value of attribute quests_completed.
-
#skills ⇒ Object
readonly
Returns the value of attribute skills.
-
#temple_completed_at ⇒ Object
readonly
Returns the value of attribute temple_completed_at.
-
#town ⇒ Object
readonly
Returns the value of attribute town.
-
#wood ⇒ Object
readonly
Returns the value of attribute wood.
Instance Method Summary collapse
-
#initialize(raw_hero_data, raw_pantheons_data) ⇒ Hero
constructor
A new instance of Hero.
Constructor Details
#initialize(raw_hero_data, raw_pantheons_data) ⇒ Hero
Returns a new instance of Hero.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/godville_kit/hero.rb', line 44 def initialize(raw_hero_data, raw_pantheons_data) if raw_hero_data @name = raw_hero_data['hero']['name'].to_s @god_name = raw_hero_data['hero']['godname'].to_s @level = raw_hero_data['hero']['level'].to_s @quest = raw_hero_data['hero']['quest'].to_s @quest_progress = raw_hero_data['hero']['quest_progress'].to_s @exp_progress = raw_hero_data['hero']['exp_progress'].to_s @health = raw_hero_data['hero']['health'].to_s @max_health = raw_hero_data['hero']['max_health'].to_s @alignment = raw_hero_data['hero']['alignment'].to_s @motto = raw_hero_data['hero']['motto'].to_s @guild = raw_hero_data['hero']['clan'].to_s @guild_rank = raw_hero_data['hero']['clan_position'].to_s @temple_completed_at = raw_hero_data['hero']['temple_completed_at'].to_s @ark_completed_at = raw_hero_data['hero']['ark_completed_at'].to_s @town = raw_hero_data['hero']['town_name'].to_s @next_town = raw_hero_data['hero']['c_town'].to_s @distance = raw_hero_data['hero']['distance'].to_s @bricks = raw_hero_data['hero']['bricks_cnt'].to_s @wood = raw_hero_data['hero']['wood'].to_s @god_power = raw_hero_data['hero']['godpower'].to_s @gold = raw_hero_data['hero']['gold'].to_s @monsters_killed = raw_hero_data['hero']['monsters_killed'].to_s @deaths = raw_hero_data['hero']['death_count'].to_s @arena_wins = raw_hero_data['hero']['arena_won'].to_s @arena_losses = raw_hero_data['hero']['arena_lost'].to_s @approximate_age = raw_hero_data['hero']['age_str'].to_s @birthday = raw_hero_data['hero']['birthday'].to_s @accumulator = raw_hero_data['hero']['accumulator'].to_s @quests_completed = raw_hero_data['hero']['quests_completed'].to_s @monster_name = raw_hero_data['hero']['monster_name'].to_s @monster_progress = raw_hero_data['hero']['monster_progress'].to_s @aura_name = raw_hero_data['hero']['aura_name'].to_s @aura_time = raw_hero_data['hero']['aura_time'].to_s @max_inventory = raw_hero_data['hero']['inventory_max_num'].to_s # Inventory @inventory = raw_hero_data['inventory'].keys.map do |key| GodvilleKit::Item.new(key, raw_hero_data['inventory'][key].to_s) end # Equipment @equipment = GodvilleKit::Equipment.new(raw_hero_data['equipment']) # Skils @skills = raw_hero_data['skills'].map do |raw_skill_data| GodvilleKit::Skill.new(raw_skill_data) end # Diary @diary = raw_hero_data['diary'].map do |raw_diary_entry_data| GodvilleKit::DiaryEntry.new(raw_diary_entry_data) end end # Pantheons if raw_pantheons_data @pantheons = GodvilleKit::Pantheons.new(raw_pantheons_data) end end |
Instance Attribute Details
#accumulator ⇒ Object (readonly)
Returns the value of attribute accumulator.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def accumulator @accumulator end |
#alignment ⇒ Object (readonly)
Returns the value of attribute alignment.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def alignment @alignment end |
#approximate_age ⇒ Object (readonly)
Returns the value of attribute approximate_age.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def approximate_age @approximate_age end |
#arena_losses ⇒ Object (readonly)
Returns the value of attribute arena_losses.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def arena_losses @arena_losses end |
#arena_wins ⇒ Object (readonly)
Returns the value of attribute arena_wins.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def arena_wins @arena_wins end |
#ark ⇒ Object (readonly)
Returns the value of attribute ark.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def ark @ark end |
#ark_completed_at ⇒ Object (readonly)
Returns the value of attribute ark_completed_at.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def ark_completed_at @ark_completed_at end |
#aura_name ⇒ Object (readonly)
Returns the value of attribute aura_name.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def aura_name @aura_name end |
#aura_time ⇒ Object (readonly)
Returns the value of attribute aura_time.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def aura_time @aura_time end |
#birthday ⇒ Object (readonly)
Returns the value of attribute birthday.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def birthday @birthday end |
#bricks ⇒ Object (readonly)
Returns the value of attribute bricks.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def bricks @bricks end |
#deaths ⇒ Object (readonly)
Returns the value of attribute deaths.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def deaths @deaths end |
#diary ⇒ Object (readonly)
Returns the value of attribute diary.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def diary @diary end |
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def distance @distance end |
#equipment ⇒ Object (readonly)
Returns the value of attribute equipment.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def equipment @equipment end |
#exp_progress ⇒ Object (readonly)
Returns the value of attribute exp_progress.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def exp_progress @exp_progress end |
#god_name ⇒ Object (readonly)
Returns the value of attribute god_name.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def god_name @god_name end |
#god_power ⇒ Object (readonly)
Returns the value of attribute god_power.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def god_power @god_power end |
#gold ⇒ Object (readonly)
Returns the value of attribute gold.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def gold @gold end |
#guild ⇒ Object (readonly)
Returns the value of attribute guild.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def guild @guild end |
#guild_rank ⇒ Object (readonly)
Returns the value of attribute guild_rank.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def guild_rank @guild_rank end |
#health ⇒ Object (readonly)
Returns the value of attribute health.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def health @health end |
#inventory ⇒ Object (readonly)
Returns the value of attribute inventory.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def inventory @inventory end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def level @level end |
#max_health ⇒ Object (readonly)
Returns the value of attribute max_health.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def max_health @max_health end |
#max_inventory ⇒ Object (readonly)
Returns the value of attribute max_inventory.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def max_inventory @max_inventory end |
#monster_name ⇒ Object (readonly)
Returns the value of attribute monster_name.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def monster_name @monster_name end |
#monster_progress ⇒ Object (readonly)
Returns the value of attribute monster_progress.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def monster_progress @monster_progress end |
#monsters_killed ⇒ Object (readonly)
Returns the value of attribute monsters_killed.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def monsters_killed @monsters_killed end |
#motto ⇒ Object (readonly)
Returns the value of attribute motto.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def motto @motto end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def name @name end |
#next_town ⇒ Object (readonly)
Returns the value of attribute next_town.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def next_town @next_town end |
#pantheons ⇒ Object (readonly)
Returns the value of attribute pantheons.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def pantheons @pantheons end |
#quest ⇒ Object (readonly)
Returns the value of attribute quest.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def quest @quest end |
#quest_progress ⇒ Object (readonly)
Returns the value of attribute quest_progress.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def quest_progress @quest_progress end |
#quests_completed ⇒ Object (readonly)
Returns the value of attribute quests_completed.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def quests_completed @quests_completed end |
#skills ⇒ Object (readonly)
Returns the value of attribute skills.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def skills @skills end |
#temple_completed_at ⇒ Object (readonly)
Returns the value of attribute temple_completed_at.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def temple_completed_at @temple_completed_at end |
#town ⇒ Object (readonly)
Returns the value of attribute town.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def town @town end |
#wood ⇒ Object (readonly)
Returns the value of attribute wood.
3 4 5 |
# File 'lib/godville_kit/hero.rb', line 3 def wood @wood end |