Sha256: 93928fc6b4cdcacd0fb02ba7b7992120af49c58539e13b76c1540b59955cf260
Contents?: true
Size: 727 Bytes
Versions: 1
Compression:
Stored size: 727 Bytes
Contents
require 'xiv_lodestone/lodestone_helper' require 'json' module XIVLodestone class CollectableList attr_reader :list Collectable = Struct.new(:name, :icon_url) def initialize(collectable_path) @list = [] parse_collectable(collectable_path) end # Uses gem Oj to dump MountList to JSON def to_json() @list.map { |obj| Hash[obj.each_pair.to_a] }.to_json end #### Private Methods #### def parse_collectable(collectable_path) collectable_path.each do |collectable| @list.push(Collectable.new( collectable['title'].split.map(&:capitalize)*' ', collectable.at_xpath('img')['src'])) end end private :parse_collectable end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
xiv_lodestone-0.0.5 | lib/xiv_lodestone/lodestone_character_collectable.rb |