Class: GovDelivery::TMS::SmsMessage

Inherits:
Object
  • Object
show all
Includes:
InstanceResource
Defined in:
lib/govdelivery/tms/resource/sms_message.rb

Overview

An SMSMessage is used to create and send a text message to a collection of Recipient objects.

Examples:

sms = client.sms_messages.build(:body => "Hello")
sms.recipients.build(:phone => "+18001002000")
sms.post
sms.get

Instance Attribute Summary collapse

Attributes included from InstanceResource

#response

Instance Method Summary collapse

Methods included from InstanceResource

included

Instance Attribute Details

#bodyString

The content of the SMS. This field will be truncated to 160 characters.

Returns:

  • (String)

    the current value of body



13
14
15
# File 'lib/govdelivery/tms/resource/sms_message.rb', line 13

def body
  @body
end

#completed_atObject (readonly)

Returns the value of attribute completed_at.



1
2
3
# File 'lib/govdelivery/tms/resource/sms_message.rb', line 1

def completed_at
  @completed_at
end

#created_atObject (readonly)

Returns the value of attribute created_at.



1
2
3
# File 'lib/govdelivery/tms/resource/sms_message.rb', line 1

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



1
2
3
# File 'lib/govdelivery/tms/resource/sms_message.rb', line 1

def id
  @id
end

#statusObject (readonly)

Returns the value of attribute status.



1
2
3
# File 'lib/govdelivery/tms/resource/sms_message.rb', line 1

def status
  @status
end

Instance Method Details

#failedObject

A CollectionResource of Recipients that failed



32
# File 'lib/govdelivery/tms/resource/sms_message.rb', line 32

collection_attribute :failed, 'Recipients'

#recipientsObject

A CollectionResource of Recipient objects



24
# File 'lib/govdelivery/tms/resource/sms_message.rb', line 24

collection_attributes :recipients

#sentObject

A CollectionResource of Recipients that sent successfully



28
# File 'lib/govdelivery/tms/resource/sms_message.rb', line 28

collection_attribute :sent, 'Recipients'