Class: XIVLodestone::CollectableList

Inherits:
Object
  • Object
show all
Defined in:
lib/xiv_lodestone/lodestone_character_collectable.rb

Defined Under Namespace

Classes: Collectable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collectable_path) ⇒ CollectableList

Returns a new instance of CollectableList.



10
11
12
13
# File 'lib/xiv_lodestone/lodestone_character_collectable.rb', line 10

def initialize(collectable_path)
  @list = []
  parse_collectable(collectable_path)
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



6
7
8
# File 'lib/xiv_lodestone/lodestone_character_collectable.rb', line 6

def list
  @list
end

Instance Method Details

#to_jsonObject

Uses gem Oj to dump MountList to JSON



15
16
17
# File 'lib/xiv_lodestone/lodestone_character_collectable.rb', line 15

def to_json()
  @list.map { |obj| Hash[obj.each_pair.to_a] }.to_json
end