Class: VerticalResponse::API::SocialPost

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

Constant Summary collapse

MESSAGE_TYPE =
'social_post'

Instance Attribute Summary

Attributes inherited from Client

#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, build_params, build_query_params, config, default_query_params, embed_resource, #initialize, resource_uri

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



29
30
31
# File 'lib/social_post.rb', line 29

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

.base_uri(*args) ⇒ Object

Base URI for the Email resource



17
18
19
# File 'lib/social_post.rb', line 17

def base_uri(*args)
  @base_uri ||= File.join(super.to_s, 'messages', 'social_posts')
end

.resource_nameObject

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



23
24
25
# File 'lib/social_post.rb', line 23

def resource_name
  'messages/social_posts'
end