Class: GovDelivery::TMS::Keyword

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

Overview

A Keyword is a word that TMS will detect in an incoming SMS message. Keywords can have Commands, and when an incoming text message has a keyword, TMS will execute the keyword’s Commands. Keywords may also have a response text field. If the response text is not blank, the system will send an SMS reply to the user immediately with the given text.

Examples:

keyword = client.keywords.build(:name => "HOWDY")
keyword.post
keyword.name = "INFO"
keyword.response_text = "Please call our support staff at 1-555-555-5555"
keyword.put
keyword.delete

Instance Attribute Summary collapse

Attributes included from InstanceResource

#response

Instance Method Summary collapse

Methods included from InstanceResource

included

Instance Attribute Details

#nameString

The name of the keyword. The system will scan an incoming SMS for this string (in a case-insensitive manner).

Returns:

  • (String)

    the current value of name



19
20
21
# File 'lib/govdelivery/tms/resource/keyword.rb', line 19

def name
  @name
end

#response_textString

(Optional) The static text with which to reply to an SMS to this keyword. This value can be blank, in which case the handset user will not receive a response. Note that all keyword commands will be executed, regardless of the value of response_text.

Returns:

  • (String)

    the current value of response_text



19
20
21
# File 'lib/govdelivery/tms/resource/keyword.rb', line 19

def response_text
  @response_text
end

Instance Method Details

#commandsObject

A CollectionResource of Command objects



27
# File 'lib/govdelivery/tms/resource/keyword.rb', line 27

collection_attributes :commands