Skip to content

Commit

Permalink
Update character data
Browse files Browse the repository at this point in the history
* Adds missing MIMO and CJ data options to the `all_data` option.
* Adds `extended` option for retrieving extended character data.
  • Loading branch information
mattantonelli committed Aug 3, 2020
1 parent a3c373a commit 3cc181a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
xivapi (0.3.1)
xivapi (0.3.2)
rest-client (~> 2.0)

GEM
Expand All @@ -14,7 +14,7 @@ GEM
domain_name (~> 0.5)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
mime-types-data (3.2020.0512)
netrc (0.11.0)
rake (10.4.2)
rest-client (2.1.0)
Expand All @@ -24,7 +24,7 @@ GEM
netrc (~> 0.8)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
unf_ext (0.0.7.7)
yard (0.9.19)

PLATFORMS
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A Ruby library for [XIVAPI](https://www.xivapi.com/).
Add this line to your application's Gemfile:

```ruby
gem 'xivapi', git: 'https://github.com/xivapi/xivapi-ruby.git', tag: 'v0.3.1'
gem 'xivapi', git: 'https://github.com/xivapi/xivapi-ruby.git', tag: 'v0.3.2'
```

And then run:
Expand Down
6 changes: 4 additions & 2 deletions lib/xivapi/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module XIVAPI::Request
LODESTONE_LIMIT = 50.freeze

# Options used to retrieve all data when querying a character
ALL_CHARACTER_DATA = 'AC,FR,FC,FCM,PVP'.freeze
ALL_CHARACTER_DATA = 'AC,MIMO,CJ,FR,FC,FCM,PVP'.freeze

# @param indexes [String, Array <String>] One or more indexes to search on
# @param string [String] Value to search for in the string column
Expand Down Expand Up @@ -63,11 +63,13 @@ def servers(group: false)

# @param id [Integer] Character ID
# @param all_data [true, false] Return the full set of character data
# @param extended [true, false] Return additional data for various fields (e.g. name, icon)
# @param data [String, Array <String>] Additional data to request, see: https://xivapi.com/docs/Character#character
# @param columns [String, Array <String>] One or more columns to limit results to
# @return [OpenStruct] The requested character
def character(id: nil, all_data: false, data: [], columns: [])
def character(id: nil, all_data: false, extended: false, data: [], columns: [])
params = { data: character_data(all_data, data), columns: [*columns].join(',') }
params[:extended] = 1 if extended
request(self, "character/#{id}", params)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/xivapi/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module XIVAPI
# Gem version
VERSION = "0.3.1"
VERSION = "0.3.2"
end

0 comments on commit 3cc181a

Please sign in to comment.