Sha256: 5441bd07945627e40df142ab6d5f96dbd8c841c66c4ed1ff067e230b105851ff

Contents?: true

Size: 667 Bytes

Versions: 22

Compression:

Stored size: 667 Bytes

Contents

module RubySpeech
  module GRXML
    ##
    #
    # The tag element is one of the valid expansion elements for the SGR rule element
    #
    #   http://www.w3.org/TR/speech-grammar/#S2.6
    #
    #
    # TODO: Make sure this is complete...
    #
    #
    class Tag < Element

      register :tag

      VALID_CHILD_TYPES = [Nokogiri::XML::Element, Nokogiri::XML::Text, String].freeze

      def <<(arg)
        raise InvalidChildError, "A Tag can only accept Strings as children" unless VALID_CHILD_TYPES.include? arg.class
        super
      end

      def regexp_content # :nodoc:
        "?<t#{content}>"
      end
    end # Tag
  end # GRXML
end # RubySpeech

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ruby_speech-3.0.1-java lib/ruby_speech/grxml/tag.rb
ruby_speech-3.0.1 lib/ruby_speech/grxml/tag.rb
ruby_speech-3.0.0-java lib/ruby_speech/grxml/tag.rb
ruby_speech-3.0.0 lib/ruby_speech/grxml/tag.rb
ruby_speech-2.4.0-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.4.0 lib/ruby_speech/grxml/tag.rb
ruby_speech-2.3.2-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.3.2 lib/ruby_speech/grxml/tag.rb
ruby_speech-2.3.1-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.3.1 lib/ruby_speech/grxml/tag.rb
ruby_speech-2.3.0-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.3.0 lib/ruby_speech/grxml/tag.rb
ruby_speech-2.2.2-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.2.2 lib/ruby_speech/grxml/tag.rb
ruby_speech-2.2.1-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.2.1 lib/ruby_speech/grxml/tag.rb
ruby_speech-2.2.0-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.2.0 lib/ruby_speech/grxml/tag.rb
ruby_speech-2.1.2-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.1.2 lib/ruby_speech/grxml/tag.rb