123456789_123456789_123456789_123456789_123456789_

Class: REXML::DTD::NotationDecl

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: REXML::Child
Defined in: lib/rexml/dtd/notationdecl.rb

Constant Summary

Class Method Summary

Instance Attribute Summary

::REXML::Child - Inherited

#next_sibling
#next_sibling=

Sets the next sibling of this child.

#parent

The Parent of this object.

#parent=

Sets the parent of this child to the supplied argument.

#previous_sibling
#previous_sibling=

Sets the previous sibling of this child.

::REXML::Node - Included

Instance Method Summary

::REXML::Child - Inherited

#bytes

This doesn’t yet handle encodings.

#document
Returns

the document this child belongs to, or nil if this child belongs to no document.

#remove

Removes this child from the parent.

#replace_with

Replaces this object with another object.

::REXML::Node - Included

#each_recursive

Visit all subnodes of self recursively.

#find_first_recursive

Find (and return) first subnode (recursively) for which the block evaluates to true.

#indent,
#index_in_parent

Returns the position that self holds in its parent’s array, indexed from 1.

#next_sibling_node, #previous_sibling_node,
#to_s
indent

Constructor Details

.new(src) ⇒ NotationDecl

[ GitHub ]

  
# File 'lib/rexml/dtd/notationdecl.rb', line 10

def initialize src
  super()
  if src.match( PUBLIC )
    md = src.match( PUBLIC, true )
  elsif src.match( SYSTEM )
    md = src.match( SYSTEM, true )
  else
    raise ParseException.new( "error parsing notation: no matching pattern", src )
  end
  @name = md[1]
  @middle = md[2]
  @rest = md[3]
end

Class Method Details

.parse_source(source, listener)

[ GitHub ]

  
# File 'lib/rexml/dtd/notationdecl.rb', line 33

def NotationDecl.parse_source source, listener
  md = source.match( PATTERN_RE, true )
  thing = md[0].squeeze(" \t\n\r")
  listener.send inspect.downcase, thing
end

Instance Method Details

#to_s

[ GitHub ]

  
# File 'lib/rexml/dtd/notationdecl.rb', line 24

def to_s
  "<!NOTATION #@name #@middle #@rest>"
end

#write(output, indent)

[ GitHub ]

  
# File 'lib/rexml/dtd/notationdecl.rb', line 28

def write( output, indent )
  indent( output, indent )
  output << to_s
end