Class: Plivo::XML::W

Inherits:
Element show all
Defined in:
lib/plivo/xml/w.rb

Constant Summary collapse

VALID_ROLE_ATTRIBUTE_VALUES =
%w(amazon:VB amazon:VBD amazon:SENSE_1)

Constants inherited from Element

Element::SSML_TAGS

Instance Attribute Summary

Attributes inherited from Element

#name, #node

Instance Method Summary collapse

Methods inherited from Element

#add, #add_attribute, #convert_value, #hyphenate, #method_missing, #to_s, #to_xml

Constructor Details

#initialize(body, attributes = {}) ⇒ W

Returns a new instance of W.



9
10
11
12
13
14
# File 'lib/plivo/xml/w.rb', line 9

def initialize(body, attributes = {})
  if attributes && attributes[:role] && !VALID_ROLE_ATTRIBUTE_VALUES.include?(attributes[:role])
    raise PlivoXMLError, "invalid attribute value #{attributes[:role]} for role"
  end
  super(body, attributes)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Plivo::XML::Element