Repository URL to install this package:
|
Version:
4.0 ▾
|
require 'roar/client'
require 'active_support'
module GetFitter
class Venue < Base
include GetFitter::VenueRepresenter
# Define the source name in the getfitter api
RESOURCE_NAME = 'venues'
#
# Fetch all events organised at a specific saved venue,
# optionally filtered by their start time.
# @return Events
# @example Fetch Events for venue
# venue.fetch_events
# @api public
def fetch_events
fetch_events_within
end
def fetch_events_within(params = {})
object = GetFitter::Events.new
events_endpoint = GetFitter::Event.const_get('RESOURCE_NAME')
params.slice(:start_time, :end_time, :page, :per_page)
GetFitter::Request.new(
resource: object,
uri: "#{GetFitter::API.configuration.url[0]}/"\
"#{RESOURCE_NAME}/#{id}/#{events_endpoint}",
params: params).fetch
end
end
end