Module: ArmoryApi::Client::Item

Included in:
ArmoryApi::Client
Defined in:
lib/armory_api/client/item.rb

Instance Method Summary collapse

Instance Method Details

#item(id) ⇒ Hash

Retrieve an item

Parameters:

  • id (Integer)

    the item id

Returns:

  • (Hash)

    the item



9
10
11
# File 'lib/armory_api/client/item.rb', line 9

def item(id)
  get("/api/wow/item/#{id}")
end

#item_set(id, full = false) ⇒ Hash

Retrieve an item set.

If full is set to true ArmoryApi will retrieve each item of the set.

Parameters:

  • id (Integer)

    the set id

  • full (Boolean) (defaults to: false)

    also retrieve each item of the set

Returns:

  • (Hash)

    the item set



19
20
21
22
23
24
25
# File 'lib/armory_api/client/item.rb', line 19

def item_set(id, full=false)
  res = get("/api/wow/item/set/#{id}")
  if full
    res.items.map! {|i| item(i)}
  end
  res
end