Class: SimpleMappr::Transporter
- Inherits:
-
Object
- Object
- SimpleMappr::Transporter
- Defined in:
- lib/simple-mappr/transporter.rb
Class Method Summary collapse
Class Method Details
.ping ⇒ Object
21 22 23 |
# File 'lib/simple-mappr/transporter.rb', line 21 def self.ping send_data({ ping: true }) end |
.send_data(params, download = false) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/simple-mappr/transporter.rb', line 9 def self.send_data params, download = false Validator.validate_type(params, 'Hash') params.delete_if{ |k,v| !v } RestClient.post(API_URL, params) do |response, request, result, &block| if response.code == 303 && download response.follow_redirection else JSON.parse(response.body, :symbolize_names => true) end end end |