lib/punchblock/media_container.rb in punchblock-0.7.1 vs lib/punchblock/media_container.rb in punchblock-0.7.2
- old
+ new
@@ -16,21 +16,22 @@
##
# @return [String] the SSML document to render TTS
#
def ssml
- children.to_xml
+ node = children.first
+ RubySpeech::SSML.import node if node
end
##
# @param [String] ssml the SSML document to render TTS
#
def ssml=(ssml)
- if ssml.instance_of?(String)
- self << RayoNode.new('').parse(ssml) do |config|
- config.noblanks.strict
- end
+ return unless ssml
+ unless ssml.is_a?(RubySpeech::SSML::Element)
+ ssml = RubySpeech::SSML.import ssml
end
+ self << ssml
end
def inspect_attributes # :nodoc:
[:voice, :ssml] + super
end
\ No newline at end of file