module EventbriteSDK::Resource::Operations::Endpoint::InstanceMethods

Public Instance Methods

full_url(request = EventbriteSDK) click to toggle source
# File lib/eventbrite_sdk/resource/operations/endpoint.rb, line 102
def full_url(request = EventbriteSDK)
  request.url path
end
path(postfixed_path = '') click to toggle source
# File lib/eventbrite_sdk/resource/operations/endpoint.rb, line 85
def path(postfixed_path = '')
  resource_path = self.class.path(new?).dup
  tokens = resource_path.scan(/:\w+/)

  full_path = tokens.reduce(resource_path) do |path_frag, token|
    method = token.delete(':')
    path_frag.gsub(token, send(method).to_s)
  end

  if postfixed_path.empty?
    full_path
  else
    full_path += '/' unless full_path.end_with?('/')
    "#{full_path}#{postfixed_path}"
  end
end