module SmashRuby::Request

Constants

M

Public Class Methods

get(url, slug, type) click to toggle source
# File lib/smash_ruby/request.rb, line 8
def self.get(url, slug, type)
  response = Faraday.get(url)

  if response.success?
    M.Right(JSON.parse(response.body))
  else
    M.Left(SmashRuby::Errors::ErrorHandler.build_error(
      type,
      slug,
      response.status
    ))
  end
end