lib/eventbrite_sdk/media.rb in eventbrite_sdk-3.1.1 vs lib/eventbrite_sdk/media.rb in eventbrite_sdk-3.1.2

- old
+ new

@@ -1,19 +1,18 @@ module EventbriteSDK # This module implements media upload to Eventbrite based on: # https://docs.evbhome.com/apidocs/reference/uploads/?highlight=logo - class Media < Resource resource_path 'media/:id' attr_reader :image_type, :file VALID_TYPES = { event_logo: 'image-event-logo', organizer_logo: 'image-organizer-logo', user_photo: 'image-user-photo', - event_view_from_seat: 'image-event-view-from-seat', + event_view_from_seat: 'image-event-view-from-seat' }.freeze schema_definition do string 'crop_mask' string 'original' @@ -44,22 +43,20 @@ def get_instructions(image_type, request = EventbriteSDK) type = VALID_TYPES[image_type] unless type - raise ArgumentError.new( - "image_type needs to be one of #{VALID_TYPES.keys}" - ) + raise ArgumentError, "image_type needs to be one of #{VALID_TYPES.keys}" end request.get(url: path('upload'), query: { type: type }) end def eventbrite_upload(file, instructions) RestClient.post( instructions['upload_url'], instructions['upload_data'].merge(file: file), - multipart: true, + multipart: true ) end def notify(upload_token, request = EventbriteSDK) response = request.post(