lib/eventbrite_sdk.rb in eventbrite_sdk-3.1.1 vs lib/eventbrite_sdk.rb in eventbrite_sdk-3.1.2
- old
+ new
@@ -12,10 +12,12 @@
require 'eventbrite_sdk/resource/attributes'
require 'eventbrite_sdk/resource/null_schema_definition'
require 'eventbrite_sdk/resource/schema_definition'
require 'eventbrite_sdk/blank_resource_list'
require 'eventbrite_sdk/resource'
+require 'eventbrite_sdk/resource/field'
+require 'eventbrite_sdk/resource/field_comparable'
require 'eventbrite_sdk/resource_list'
require 'eventbrite_sdk/lists/owned_event_orders_list'
require 'eventbrite_sdk/attendee'
@@ -34,27 +36,27 @@
module EventbriteSDK
BASE = "https://www.eventbriteapi.com/v#{VERSION.split('.').first}".freeze
EXCEPTION_MAP = {
RestClient::ResourceNotFound => {
class: ResourceNotFound,
- message: 'requested object was not found',
+ message: 'requested object was not found'
},
RestClient::BadRequest => {
class: BadRequest,
- message: 'invalid request',
+ message: 'invalid request'
},
RestClient::Forbidden => {
class: Forbidden,
- message: 'not authorized',
+ message: 'not authorized'
},
RestClient::InternalServerError => {
class: InternalServerError,
- message: 'internal server error',
+ message: 'internal server error'
},
RestClient::Unauthorized => {
class: Unauthorized,
- message: 'unauthorized request',
+ message: 'unauthorized request'
}
}.freeze
THREAD_EB_API_TOKEN_KEY = :eb_api_token
VERIFY_SSL = true
@@ -99,12 +101,10 @@
# Don't convert nil to json.
#
# BadRequest is raised when you publish an event because the body sent is
# "null" (invalid json) and the API rejects it.
- if params[:payload]
- params[:payload] = params[:payload].to_json
- end
+ params[:payload] = params[:payload].to_json if params[:payload]
request(params)
end
def self.delete(params)