Sha256: 1c42fba3db7faf761ce9ff7756892ddd0f70749181e2a1cf482de61491e3cc18
Contents?: true
Size: 891 Bytes
Versions: 14
Compression:
Stored size: 891 Bytes
Contents
require 'addressable/uri' module Poms module Api module Uris # URI for the /schedule API module Schedule API_PATH = '/v1/api/schedule'.freeze module_function def now(base_uri, channel) uri_for_path( base_uri, "/channel/#{channel}", stop: Time.now.iso8601, sort: 'desc', max: 1 ) end def next(base_uri, channel) uri_for_path( base_uri, "/channel/#{channel}", start: Time.now.iso8601, sort: 'asc', max: 1 ) end def uri_for_path(base_uri, path = nil, query = {}) uri = base_uri.merge(path: "#{API_PATH}#{path}") uri.query_values = query uri end private_class_method :uri_for_path end end end end
Version data entries
14 entries across 14 versions & 1 rubygems