Class: Vonage::Voice::Ncco

Inherits:
Object
  • Object
show all
Defined in:
lib/vonage/voice/ncco.rb

Constant Summary collapse

ACTIONS =
{
  connect: Vonage::Voice::Actions::Connect,
  conversation: Vonage::Voice::Actions::Conversation,
  input: Vonage::Voice::Actions::Input,
  notify: Vonage::Voice::Actions::Notify,
  record: Vonage::Voice::Actions::Record,
  stream: Vonage::Voice::Actions::Stream,
  talk: Vonage::Voice::Actions::Talk
}

Class Method Summary collapse

Class Method Details

.create(*actions) ⇒ Array

Create an NCCO

Examples:

talk = Vonage::Voice::Ncco.talk(text: 'This is sample text')
input = Vonage::Voice::Ncco.input(type: ['dtmf'])
ncco = Vonage::Voice::Ncco.create(talk, input)

Parameters:

  • actions (Hash)

    a customizable set of options

Options Hash (*actions):

Returns:

  • (Array)

See Also:



40
41
42
# File 'lib/vonage/voice/ncco.rb', line 40

def self.create(*actions)
  actions.flatten!
end

.method_missing(method) ⇒ Object

Raises:



24
25
26
# File 'lib/vonage/voice/ncco.rb', line 24

def self.method_missing(method)
  raise ClientError.new("NCCO action must be one of the valid options. Please refer to https://developer.nexmo.com/voice/voice-api/ncco-reference#ncco-actions for a complete list.")
end