initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'httparty'
|
||||
|
||||
module FO::Client
|
||||
class PokeAPI
|
||||
include HTTParty
|
||||
base_uri 'pokeapi.co'
|
||||
|
||||
def species(id = nil)
|
||||
if id.nil?
|
||||
self.class.get('/api/v2/pokemon-species', {query: {offset: 0, limit: 100_000}})
|
||||
else
|
||||
self.class.get("/api/v2/pokemon-species/#{id}/")
|
||||
end
|
||||
end
|
||||
|
||||
def pokemon(id)
|
||||
self.class.get("/api/v2/pokemon/#{id}/")
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user