Method: Plivo::XML::Phoneme#initialize

Defined in:
lib/plivo/xml/phoneme.rb

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

Returns a new instance of Phoneme.



9
10
11
12
13
14
15
16
17
# 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