Class: RubySpeech::GRXML::Tag

Inherits:
Element
  • Object
show all
Defined in:
lib/ruby_speech/grxml/tag.rb

Overview

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…

Constant Summary collapse

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

Instance Attribute Summary

Attributes included from RubySpeech::GenericElement

#parent

Instance Method Summary collapse

Methods inherited from Element

module, namespace, root_element, #to_doc

Methods included from RubySpeech::GenericElement

#+, #==, #base_uri, #base_uri=, #build, #children, #clone, #create_node, #embed, #eql?, #eval_dsl_block, included, #inherit, #initialize, #inspect, #mass_assign, #method_missing, #namespace=, #namespace_href, #node, #nokogiri_children, #read_attr, #respond_to_missing?, #string, #to_s, #traverse, #version, #version=, #write_attr

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RubySpeech::GenericElement

Instance Method Details

#<<(arg) ⇒ Object

Raises:


19
20
21
22
# File 'lib/ruby_speech/grxml/tag.rb', line 19

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

#regexp_contentObject

:nodoc:


24
25
26
# File 'lib/ruby_speech/grxml/tag.rb', line 24

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