Class: Flyticket::Endpoint
- Inherits:
-
Object
- Object
- Flyticket::Endpoint
- Includes:
- HTTParty
- Defined in:
- lib/flyticket/endpoint.rb
Class Method Summary collapse
-
.get_many(fragment, options) ⇒ Object
Gets many events.
-
.get_one(fragment, options) ⇒ Object
Gets a single event.
-
.key ⇒ Object
Returns the key used to get the list of entries from Ticketfly’s response.
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, ) response = get fragment, query: query_string() 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, ) response = get fragment, query: query_string() handle_error(response) objectify response[key].first end |
.key ⇒ Object
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 |