Sha256: b0c5af0992cf759e7610796322cae1264c618d8e6f593c000519309602b646c9

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 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:
        "?<#{content}>"
      end
    end # Tag
  end # GRXML
end # RubySpeech

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby_speech-2.1.0-java lib/ruby_speech/grxml/tag.rb
ruby_speech-2.1.0 lib/ruby_speech/grxml/tag.rb