Class: Reach::REST::Api::Messaging

Inherits:
Version
  • Object
show all
Defined in:
lib/reach-ruby/rest/api/messaging.rb,
lib/reach-ruby/rest/api/messaging/messaging_item.rb

Defined Under Namespace

Classes: MessagingItemContext, MessagingItemInstance, MessagingItemList, MessagingItemPage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #check, #create, #delete, #dispatch, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #start, #stream, #unschedule, #update, #url_without_pagination_info

Constructor Details

#initialize(domain) ⇒ Messaging

Initialize the Messaging version of Api



22
23
24
25
26
# File 'lib/reach-ruby/rest/api/messaging.rb', line 22

def initialize(domain)
    super
    @version = 'rest'
    @messaging_items = nil
end

Instance Method Details

#messaging_items(message_id = :unset) ⇒ Reach::REST::Api::Messaging::MessagingItemContext, Reach::REST::Api::Messaging::MessagingItemList

Parameters:

  • message_id (String) (defaults to: :unset)

Returns:



33
34
35
36
37
38
39
40
41
42
# File 'lib/reach-ruby/rest/api/messaging.rb', line 33

def messaging_items(message_id=:unset)
    if message_id.nil?
        raise ArgumentError, 'message_id cannot be nil'
    end
    if message_id == :unset
        @messaging_items ||= MessagingItemList.new self
    else
        MessagingItemContext.new(self, message_id)
    end
end

#to_sObject

Provide a user friendly representation



45
46
47
# File 'lib/reach-ruby/rest/api/messaging.rb', line 45

def to_s
    '<Reach::REST::Api::Messaging>';
end