Class: EdmTrain::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/edm_train/events.rb

Overview

Events API

Class Method Summary collapse

Class Method Details

.allArray<Event>

Returns all known events

Returns:



8
9
10
# File 'lib/edm_train/events.rb', line 8

def self.all
  EdmTrain.client.get('/events').map { |raw_event| Event.new(raw_event) }
end

.find(params) ⇒ Array<Event>

Search for events matching the given paramaters

Examples:

EdmTrain::Events.find(locationIds: 102) # Find events near location 102 (Detroit, Michigan)

Parameters:

  • params (Hash)

    All fields are optional

Options Hash (params):

  • :eventName (String)

    The name of the event, such as the name of a festival. Most events do not have names. If an event has no artists, then it will have a name.

  • :artistIds (String)

    One or more artist ids to retrieve events for. Artist ids can be determined by looking at an existing event where they are performing.

  • :venueIds (String)

    One or more venue ids to retrieve events for. Venue ids can be determined by looking at an existing event for that location.

  • :locationIds (String)

    One or more location ids to retrieve events for. Location ids can be determined by using the Locations API below. All live streams will be included unless livestreamInd is set to false.

  • :startDate (String)

    Retrieve events occurring at or after this local date (only future events will be returned).

  • :endDate (String)

    Retrieve events occurring at or before this local date.

  • :createdStartDate (String)

    Retrieve events added to Edmtrain at or after this UTC date (only future events will be returned).

  • :createdEndDate (String)

    Retrieve events added to Edmtrain at or before this UTC date.

  • :festivalInd (String)

    Set to true to return only festivals (default is not set). Set to false to exclude festivals.

  • :livestreamInd (String)

    Set to true to return only live streams (default is not set). Set to false to exclude live streams.

Returns:



27
28
29
# File 'lib/edm_train/events.rb', line 27

def self.find(params)
  EdmTrain.client.get('/events', params).map { |raw_event| Event.new(raw_event) }
end