class Animemap::Client

Constants

API_ENDPOINT

Public Class Methods

new() click to toggle source
# File lib/animemap/client.rb, line 9
def initialize
  @connection = Faraday::Connection.new(:url => API_ENDPOINT) do |faraday|
    faraday.use Faraday::Adapter::NetHttp
  end
end

Public Instance Methods

find_programs_by_area(area) click to toggle source
# File lib/animemap/client.rb, line 15
def find_programs_by_area(area)
  res = @connection.get '/api/table/' + area + '.json'
  if res.success? then
    body = JSON.parse(res.body, :symbolize_names => true)
    return body[:response][:item]
  end
end