Class: TidaSinaWeibo::RestClientWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/tida_sina_weibo/rest_client_wrapper.rb

Instance Method Summary collapse

Instance Method Details

#get(url, data) ⇒ Object



6
7
8
9
10
11
# File 'lib/tida_sina_weibo/rest_client_wrapper.rb', line 6

def get(url, data)
  JSON.parse RestClient.get(url, data)
rescue RestClient::Exception => e
  ex = RestClientException.new e
  raise ex
end

#post(url, data) ⇒ Object



13
14
15
16
17
18
# File 'lib/tida_sina_weibo/rest_client_wrapper.rb', line 13

def post(url, data)
  JSON.parse RestClient.post(url, data)
rescue RestClient::Exception => e
  ex = RestClientException.new e
  raise ex
end