Sha256: 5a5dec687b69f60bc2d4f017db76e6fa23ecf50948821ebf628b824eac28ee5d
Contents?: true
Size: 438 Bytes
Versions: 3
Compression:
Stored size: 438 Bytes
Contents
require 'http' module Selly module Operations module Create def create(params = {}) response = HTTP.post("#{API_ROOT}#{resource_url}", headers: Selly.request_headers, json: params) parsed = response.parse if parsed.class == Hash && (response.code < 200 || response.code > 300) raise SellyError.new(parsed['errors']), parsed['message'] end parsed end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
selly-2.0.9 | lib/selly/operations/create.rb |
selly-2.0.8 | lib/selly/operations/create.rb |
selly-2.0.7 | lib/selly/operations/create.rb |