Class: GovDelivery::TMS::Command

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

Overview

A command is a combination of behavior and parameters that should be executed when an incoming SMS message matches the associated Keyword.

Examples:

command = keyword.commands.build(:name => "subscribe to news", :command_type => "dcm_subscribe", :dcm_account_code => "NEWS", :dcm_topic_codes => "NEWS_1, NEWS_2")
command.post
command.dcm_topic_codes += ", NEWS_5"
command.put
command.delete

Instance Attribute Summary collapse

Attributes included from InstanceResource

#response

Method Summary

Methods included from InstanceResource

included

Instance Attribute Details

#command_typeString

The type of this command. A list of valid types can be found by querying the CommandType list.

Returns:

  • (String)

    the current value of command_type



15
16
17
# File 'lib/govdelivery/tms/resource/command.rb', line 15

def command_type
  @command_type
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#nameString

The name of the command. This will default to the command_type if not supplied.

Returns:

  • (String)

    the current value of name



15
16
17
# File 'lib/govdelivery/tms/resource/command.rb', line 15

def name
  @name
end

#paramsHash

A Hash of string/string pairs used as configuration for this command.

Returns:

  • (Hash)

    the current value of params



15
16
17
# File 'lib/govdelivery/tms/resource/command.rb', line 15

def params
  @params
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end