Class: XIVAPI::Assets
- Inherits:
-
Object
- Object
- XIVAPI::Assets
- Defined in:
- lib/xivapi/assets.rb
Overview
Endpoints for accessing game data on a file-by-file basis. Commonly useful for fetching icons or other textures to display on the web.
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#get(params = {}) ⇒ Buffer, String
Read an asset from the game at the specified path, converting it into a usable format.
-
#initialize(client) ⇒ XIVAPI::Assets
constructor
Initialize a new Assets client for making API requests.
-
#map(territory, index, params = {}) ⇒ Buffer, String
Retrieve the specified map, composing it from split source files if necessary.
Constructor Details
#initialize(client) ⇒ XIVAPI::Assets
Initialize a new Assets client for making API requests.
9 10 11 |
# File 'lib/xivapi/assets.rb', line 9 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/xivapi/assets.rb', line 4 def client @client end |
Instance Method Details
#get(params = {}) ⇒ Buffer, String
Read an asset from the game at the specified path, converting it into a usable format. If no valid conversion between the game file type and specified format exists, an error will be returned.
16 17 18 |
# File 'lib/xivapi/assets.rb', line 16 def get(params = {}) client.request("asset", params) end |
#map(territory, index, params = {}) ⇒ Buffer, String
Retrieve the specified map, composing it from split source files if necessary.
23 24 25 |
# File 'lib/xivapi/assets.rb', line 23 def map(territory, index, params = {}) client.request("asset/map/#{territory}/#{index}", params) end |