class TangaServices::HTTP
Public Class Methods
new(method, *args)
click to toggle source
# File lib/tanga_services/http.rb, line 25 def initialize(method, *args) @method = method @args = *args end
Public Instance Methods
call()
click to toggle source
# File lib/tanga_services/http.rb, line 30 def call begin Http::Exceptions.wrap_and_check do response = HTTParty.send(@method, *@args) response.parsed_response # See that the response can be accessed response end rescue Http::Exceptions::HttpException, JSON::ParserError fail TangaServices::HTTP::Exception end end