Skip to content

Commit 74580de

Browse files
committed
Add characters endpoint
Allows users to query multiple characters simultaneously by ID
1 parent 914f35d commit 74580de

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
xivapi (0.2.1)
4+
xivapi (0.2.2)
55
rest-client (~> 2.0.2)
66

77
GEM

lib/xivapi/request.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ def character(id: nil, all_data: false, poll: false, columns: [])
9797
request_cached(self, "character/#{id}", :character, params, poll)
9898
end
9999

100+
# @param ids [String, Array<Integer>] Character IDs
101+
# @param all_data [true, false] Return the full set of character data
102+
# @param columns [String, Array <String>] One or more columns to limit results to
103+
# @return [Array<OpenStruct>] The requested characters
104+
def characters(ids: nil, all_data: false, columns: [])
105+
body = { ids: [*ids].join(','), data: all_data ? ALL_CHARACTER_DATA : nil, columns: [*columns].join(',') }
106+
request(self, 'characters', {}, body)
107+
end
108+
100109
# @param name [String] Character name
101110
# @param server [String] Character server
102111
# @param columns [String, Array <String>] One or more columns to limit results to

lib/xivapi/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module XIVAPI
22
# Gem version
3-
VERSION = "0.2.1"
3+
VERSION = "0.2.2"
44
end

0 commit comments

Comments
 (0)