Class: VerticalResponse::API::SocialPost

Inherits:
Resource show all
Defined in:
lib/verticalresponse/api/social_post.rb

Constant Summary collapse

MESSAGE_TYPE =
'social_post'

Instance Attribute Summary

Attributes inherited from Client

#access_token, #response

Class Method Summary collapse

Methods inherited from Resource

class_for_resource, class_name, create, #delete, exclude_methods, find, #id, id_attribute_name, id_regexp, object_collection, resource_id_from_url, #stats, #update, #url, validate_supported_method!

Methods inherited from Client

add_default_query_param, assign_headers, base_service_uri, base_uri, base_uri_with_prefix, build_params, build_query_params, config, default_query_params, embed_resource, #initialize, resource_uri, resource_uri_with_prefix, resource_uri_with_token

Constructor Details

This class inherits a constructor from VerticalResponse::API::Client

Class Method Details

.all(options = {}) ⇒ Object

The SocialPost API does not support the ‘all’ method on its own for now. To get all social posts we need to do it through the Message API



28
29
30
# File 'lib/verticalresponse/api/social_post.rb', line 28

def all(options = {})
  Message.all(options.merge({ :message_type => MESSAGE_TYPE }))
end

.resource_nameObject

Overwrite from parent class since it’s a special type of resource name (with messages at the beginning)



22
23
24
# File 'lib/verticalresponse/api/social_post.rb', line 22

def resource_name
  'messages/social_posts'
end

.resource_uri_suffixObject



16
17
18
# File 'lib/verticalresponse/api/social_post.rb', line 16

def resource_uri_suffix
  ['messages', 'social_posts']
end