Class: Flyticket::Endpoint

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/flyticket/endpoint.rb

Direct Known Subclasses

Events, Orgs, Venues

Class Method Summary collapse

Class Method Details

.get_many(fragment, options) ⇒ Object

Gets many events



22
23
24
25
26
27
# File 'lib/flyticket/endpoint.rb', line 22

def self.get_many(fragment, options)
  response = get fragment, query: query_string(options)

  handle_error(response)
  response[key].map { |hash| objectify(hash) }
end

.get_one(fragment, options) ⇒ Object

Gets a single event



30
31
32
33
34
35
# File 'lib/flyticket/endpoint.rb', line 30

def self.get_one(fragment, options)
  response = get fragment, query: query_string(options)

  handle_error(response)
  objectify response[key].first
end

.keyObject

Returns the key used to get the list of entries from Ticketfly’s response.



17
18
19
# File 'lib/flyticket/endpoint.rb', line 17

def self.key
  base_uri.split('/').last
end