Module: DBLista::List::Server
- Defined in:
- lib/dblista/list/server.rb
Overview
Server lists
Class Method Summary collapse
-
.all ⇒ Array
Fetches all servers.
-
.premium(page = 0, limit = 10) ⇒ Hash
Fetches premium servers.
-
.search(query) ⇒ Hash
Server search.
-
.top(page = 0, limit = 10) ⇒ Hash
Fetches top servers.
Class Method Details
.all ⇒ Array
Fetches all servers
33 34 35 |
# File 'lib/dblista/list/server.rb', line 33 def self.all DBLista::List::Server.top(0, 100_000_000) end |
.premium(page = 0, limit = 10) ⇒ Hash
Fetches premium servers
24 25 26 27 28 |
# File 'lib/dblista/list/server.rb', line 24 def self.premium(page = 0, limit = 10) DBLista._page_integer page DBLista._limit_integer limit DBLista._get("/servers/list/premium/#{page}?limit=#{limit}") end |
.search(query) ⇒ Hash
Server search
41 42 43 44 45 |
# File 'lib/dblista/list/server.rb', line 41 def self.search(query) raise DBLista::Error, DBLista::Errors::QUERY_NOT_PROVIDED unless query DBLista._get("/servers/search/#{CGI.escape query.to_s}") end |
.top(page = 0, limit = 10) ⇒ Hash
Fetches top servers
13 14 15 16 17 |
# File 'lib/dblista/list/server.rb', line 13 def self.top(page = 0, limit = 10) DBLista._page_integer page DBLista._limit_integer limit DBLista._get("/servers/list/top/#{page}?limit=#{limit}") end |