Class: Valorant::Misc
- Inherits:
-
Object
- Object
- Valorant::Misc
- Defined in:
- lib/api/misc.rb
Overview
This class is used to fetch data from the Valorant API -> ENDPOINTS: /v1/website/, /v1/leaderboard/, v1/content/, v1/status/
Class Method Summary collapse
- .articles(filter = '', locale = 'en-us') ⇒ Object
- .content ⇒ Object
- .leader_board(region = 'eu', name = '', tag = '') ⇒ Object
- .server_status(region) ⇒ Object
Class Method Details
.articles(filter = '', locale = 'en-us') ⇒ Object
12 13 14 |
# File 'lib/api/misc.rb', line 12 def self.articles(filter = '', locale = 'en-us') Articles.new(fetch_resposne("v1/website/#{validate_locale(locale)}?filter=#{validate_filter(filter)}")) end |
.content ⇒ Object
20 21 22 |
# File 'lib/api/misc.rb', line 20 def self.content Content.new(fetch_resposne('v1/content')) end |
.leader_board(region = 'eu', name = '', tag = '') ⇒ Object
16 17 18 |
# File 'lib/api/misc.rb', line 16 def self.leader_board(region = 'eu', name = '', tag = '') LeaderBoard.new(fetch_resposne("v1/leaderboard/#{region}?name=#{name}&tag=#{tag}", validate: false)) end |
.server_status(region) ⇒ Object
24 25 26 |
# File 'lib/api/misc.rb', line 24 def self.server_status(region) fetch_resposne("v1/status/#{region}")['data'].transform_keys(&:to_sym) end |