Skip to content

Commit bf9e64a

Browse files
committed
Search tweaks
Converts dots in search result keys to underscores. Removes the page parameter from the search endpoint since this is handled internally by the paginator.
1 parent f5de821 commit bf9e64a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/xivapi/http.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def objectify(response)
4141
end
4242

4343
def underscore(key)
44-
key.gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase
44+
key.gsub(/([a-z\d])([A-Z])/,'\1_\2').gsub('.', '_').downcase
4545
end
4646
end
4747
end

lib/xivapi/request.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ module XIVAPI::Request
44
LODESTONE_LIMIT = 50.freeze
55

66
def search(indexes: [], string: '', string_column: 'Name_en', string_algo: 'wildcard_plus',
7-
page: 1, sort_field: nil, sort_order: nil, limit: 100, filters: [], columns: [])
7+
sort_field: nil, sort_order: nil, limit: 100, filters: [], columns: [])
88
params = { indexes: [*indexes].join(','), string: string, string_column: string_column, string_algo: string_algo,
9-
page: page, sort_field: sort_field, sort_order: sort_order,
10-
filters: [*filters].join(','), columns: [*columns].join(',') }
9+
sort_field: sort_field, sort_order: sort_order, filters: [*filters].join(','), columns: [*columns].join(',') }
1110
XIVAPI::Paginator.new(self, params, 'search', limit)
1211
end
1312

0 commit comments

Comments
 (0)