Class: VerticalResponse::API::Contact
- Defined in:
- lib/contact.rb
Instance Attribute Summary
Attributes inherited from Client
Class Method Summary collapse
-
.base_uri(*args) ⇒ Object
Base URI for the Contact resource.
- .fields(options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(*args) ⇒ Contact
constructor
A new instance of Contact.
-
#lists(options = {}) ⇒ Object
Returns all the lists this contact belongs to.
-
#messages(options = {}) ⇒ Object
Returns all the messages targetted to the current contact.
Methods inherited from Resource
all, class_for_resource, class_name, create, #delete, exclude_methods, find, #id, id_attribute_name, id_regexp, object_collection, resource_id_from_url, resource_name, #stats, #update, #url, validate_supported_method!
Methods inherited from Client
add_default_query_param, assign_headers, build_params, build_query_params, config, default_query_params, embed_resource, resource_uri
Constructor Details
#initialize(*args) ⇒ Contact
Returns a new instance of Contact.
26 27 28 29 30 |
# File 'lib/contact.rb', line 26 def initialize(*args) super @list_class = self.class.class_for_resource(List, id) = self.class.class_for_resource(Message, id) end |
Class Method Details
.base_uri(*args) ⇒ Object
Base URI for the Contact resource
17 18 19 |
# File 'lib/contact.rb', line 17 def base_uri(*args) @base_uri ||= File.join(super.to_s, 'contacts') end |
.fields(options = {}) ⇒ Object
21 22 23 |
# File 'lib/contact.rb', line 21 def fields( = {}) Response.new get(resource_uri('fields'), build_query_params()) end |
Instance Method Details
#lists(options = {}) ⇒ Object
Returns all the lists this contact belongs to
33 34 35 |
# File 'lib/contact.rb', line 33 def lists( = {}) @list_class.all() end |
#messages(options = {}) ⇒ Object
Returns all the messages targetted to the current contact
38 39 40 |
# File 'lib/contact.rb', line 38 def ( = {}) .all() end |