Sha256: d0b1d23761ed5f6a3567ada737870ad64bb72a6ad96773f68ac85a2770710de5

Contents?: true

Size: 716 Bytes

Versions: 22

Compression:

Stored size: 716 Bytes

Contents

module EventbriteSDK
  module Lists
    class OwnedEventOrdersList < ResourceList
      def search(term)
        send(:"term_provided_#{!!term}", term)

        @pagination = { 'page_count' => 1, 'page_number' => 1 }

        self
      end

      private

      # Swaps the endpoint out to allow searches
      def term_provided_true(term)
        @url_base.sub!('owned_event_orders', 'search_owned_event_orders')
        @query[:search_term] = term
      end

      # Swaps the endpoint out owned events, and removes the search_term query
      def term_provided_false(_term)
        @url_base.sub!('search_owned_event_orders', 'owned_event_orders')
        @query.delete(:search_term)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
eventbrite_sdk-3.6.0 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.4.0 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.3.1 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.3.0 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.2.0 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.1.6 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.1.5 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.1.4 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.1.3 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.1.2 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.1.1 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.1.0 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.0.11 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.0.10 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.0.9 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.0.8 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.0.7 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.0.6 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.0.5 lib/eventbrite_sdk/lists/owned_event_orders_list.rb
eventbrite_sdk-3.0.4 lib/eventbrite_sdk/lists/owned_event_orders_list.rb