Class: Aetheryte::JobParser

Inherits:
Object
  • Object
show all
Defined in:
lib/aetheryte/job_parser.rb

Overview

Parses Job input

Constant Summary collapse

JOBS =
{
  'Gladiator' => 'Gladiator',
  'Marauder' => 'Marauder',
  'Dark Knight' => 'Knight',
  'Gunbreaker' => 'Gunbreaker',
  'Conjurer' => 'Conjurer',
  'Scholar' => 'Scholar',
  'Astrologian' => 'Astrologian',
  'Sage' => 'Sage',
  'Pugilist' => 'Pugilist',
  'Lancer' => 'Lancer',
  'Rogue' => 'Rogue',
  'Samurai' => 'Samurai',
  'Reaper' => 'Reaper',
  'Archer' => 'Archer',
  'Machinist' => 'Machinist',
  'Dancer' => 'Dancer',
  'Thaumaturge' => 'Thaumaturge',
  'Summoner / Arcanist' => 'Summoner / Arcanist',
  'Red Mage' => 'Red Mage',
  'Blue Mage (Limited Job)' => 'Blue Mage',
  'Carpenter' => 'Carpenter',
  'Blacksmith' => 'Blacksmith',
  'Armorer' => 'Armorer',
  'Goldsmith' => 'Goldsmith',
  'Leatherworker' => 'Leatherworker',
  'Weaver' => 'Weaver',
  'Alchemist' => 'Alchemist',
  'Culinarian' => 'Culinarian',
  'Miner' => 'Miner',
  'Botanist' => 'Botanist',
  'Fisher' => 'Fisher'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



40
41
42
# File 'lib/aetheryte/job_parser.rb', line 40

def output
  @output
end

Instance Method Details

#parse(input:) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/aetheryte/job_parser.rb', line 42

def parse(input:)
  input.map do |li_node|
    job_name = JOBS[li_node.children.first.attributes['data-tooltip'].value]
    job_level = li_node.children.last.text

    { job: job_name, level: job_level }
  end
end