Skip to content

Commit

Permalink
Explicitly tap the creation of new Elements for ruby 1.8 compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Jul 7, 2011
1 parent 93cdcf0 commit cbe164c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ruby_speech/ssml/element.rb
Expand Up @@ -2,8 +2,8 @@ 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 }
super(element_name).tap do |new_node|
block_return = new_node.instance_eval &block if block_given?
new_node << block_return if block_return.is_a?(String)
end
Expand Down

0 comments on commit cbe164c

Please sign in to comment.