Class: Eventbrite::ContactList

Inherits:
APIResource show all
Defined in:
lib/eventbrite/resources/contact_list.rb

Instance Attribute Summary

Attributes inherited from EventbriteObject

#token

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResource

class_name, #refresh, url

Methods inherited from EventbriteObject

#[], #[]=, #as_json, construct_from, #each, #initialize, #inspect, #keys, #next?, #next_page, #paginated?, #refresh_from, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Eventbrite::EventbriteObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Eventbrite::EventbriteObject

Class Method Details

.all(params = {}, token = nil) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/eventbrite/resources/contact_list.rb', line 3

def self.all(params={}, token=nil)
  unless user_id = params.delete(:user_id)
    raise InvalidRequestError.new('No user_id provided.')
  end

  response, token = Eventbrite.request(:get, self.all_url(user_id), token, params)
  Util.convert_to_eventbrite_object(response, token)
end

.retrieve(user_id, id, token = nil) ⇒ Object



12
13
14
15
16
17
# File 'lib/eventbrite/resources/contact_list.rb', line 12

def self.retrieve(user_id, id, token=nil)
  instance = self.new(id, token)
  instance.user_id = user_id
  instance.refresh
  instance
end

Instance Method Details

#urlObject



19
20
21
# File 'lib/eventbrite/resources/contact_list.rb', line 19

def url
  "/users/#{CGI.escape(self.user_id)}#{self.class.url}/#{CGI.escape(self.id)}"
end