lib/taric/operation/api.rb in taric-0.1.2 vs lib/taric/operation/api.rb in taric-0.1.4
- old
+ new
@@ -20,24 +20,15 @@
include Taric::Operation::LolStatus
include Taric::Operation::Match
include Taric::Operation::Stats
include Taric::Operation::Summoner
- REGION_ENDPOINT_INFO = {
- br: {region: 'br'.freeze, platform_id: 'BR1'.freeze, host: 'br.api.pvp.net'},
- eune: {region: 'eune'.freeze, platform_id: 'EUN1'.freeze, host: 'eune.api.pvp.net'},
- euw: {region: 'euw'.freeze, platform_id: 'EUW1', host: 'euw.api.pvp.net'},
- kr: {region: 'kr'.freeze, platform_id: 'KR', host: 'kr.api.pvp.net'},
- lan: {region: 'lan'.freeze, platform_id: 'LA1', host: 'lan.api.pvp.net'},
- las: {region: 'las'.freeze, platform_id: 'LA2', host: 'las.api.pvp.net'},
- na: {region: 'na'.freeze, platform_id: 'NA1', host: 'na.api.pvp.net'},
- oce: {region: 'oce'.freeze, platform_id: 'OC1', host: 'oce.api.pvp.net'},
- tr: {region: 'tr'.freeze, platform_id: 'TR1', host: 'tr.api.pvp.net'},
- ru: {region: 'ru'.freeze, platform_id: 'RU', host: 'ru.api.pvp.net'},
- pbe: {region: 'pbe'.freeze, platform_id: 'PBE1', host: 'pbe.api.pvp.net'}
- }.freeze
-
- RESPONSE = -> url, requestor, response_handler {
+ # Template for requesting the url and processing the response.
+ #
+ # @param url String
+ # @param requestor Proc (lambda)
+ # @param response_handler Proc (lambda)
+ API_CALL = -> (url:, requestor:, response_handler:) {
response_handler.(requestor.(url))
}.curry
end
end
\ No newline at end of file