class Plivo::XML::Phoneme

Constants

VALID_ALPHABET_ATTRIBUTE_VALUES

Public Class Methods

new(body, attributes = {}) click to toggle source
Calls superclass method Plivo::XML::Element::new
# File lib/plivo/xml/phoneme.rb, line 9
def initialize(body, attributes = {})
  unless attributes && attributes[:ph]
    raise PlivoXMLError, 'ph attribute is required for Phoneme'
  end
  if attributes && attributes[:alphabet] && !VALID_ALPHABET_ATTRIBUTE_VALUES.include?(attributes[:alphabet])
    raise PlivoXMLError, "invalid attribute value #{attributes[:alphabet]} for alphabet"
  end
  super(body, attributes)
end