module RubySpeech module SSML class Element < Niceogiri::XML::Node def self.new(element_name, atts = {}, &block) super element_name do |new_node| atts.each_pair { |k, v| new_node.send :"#{k}=", v } block_return = new_node.instance_eval &block if block_given? new_node << block_return if block_return.is_a?(String) end end def method_missing(method_name, *args, &block) const = SSML.const_get(method_name.to_s.titleize.gsub(' ', '')) if const && self.valid_child_type?(const) self << const.new(*args, &block) else super end end def eql?(o, *args) super o, :content, *args end end # Element end # SSML end # RubySpeech