Class: Plivo::XML::Emphasis
- Defined in:
- lib/plivo/xml/emphasis.rb
Constant Summary collapse
- VALID_LEVEL_ATTRIBUTE_VALUE =
%w(strong moderate reduced)
Constants inherited from Element
Plivo::XML::Element::SSML_TAGS
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(body, attributes = {}) ⇒ Emphasis
constructor
A new instance of Emphasis.
Methods inherited from Element
#add, #add_attribute, #convert_value, #hyphenate, #method_missing, #to_s, #to_xml
Constructor Details
#initialize(body, attributes = {}) ⇒ Emphasis
Returns a new instance of Emphasis.
9 10 11 12 13 14 |
# File 'lib/plivo/xml/emphasis.rb', line 9 def initialize(body, attributes = {}) if attributes && attributes[:level] && !VALID_LEVEL_ATTRIBUTE_VALUE.include?(attributes[:level]) raise PlivoXMLError, "invalid attribute value #{attributes[:level]} for level" end super(body, attributes) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Plivo::XML::Element