Logic related to making rest api calls to backend rails server
Raises:
6 7 8 9
# File 'lib/meroku/response_handler.rb', line 6 def process_error(result) raise Meroku::Error, JSON.parse(result).dig('errors') \ if JSON.parse(result).dig('errors') end
11 12 13 14 15 16 17 18
# File 'lib/meroku/response_handler.rb', line 11 def process_success(result) id = JSON.parse(result).dig('data', 'id') if id yield(result) if block_given? puts "OK [#{id}]" end raise Meroku::Success end