123456789_123456789_123456789_123456789_123456789_

Class: REXML::NotationDecl

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

Class Method Summary

Child - Inherited

.new

Constructor.

Instance Attribute Summary

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.

Node - Included

Instance Method Summary

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.

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(name, middle, pub, sys) ⇒ NotationDecl

[ GitHub ]

  
# File 'lib/rexml/doctype.rb', line 243

def initialize name, middle, pub, sys
  super(nil)
  @name = name
  @middle = middle
  @public = pub
  @system = sys
end

Instance Attribute Details

#public (rw)

[ GitHub ]

  
# File 'lib/rexml/doctype.rb', line 242

attr_accessor :public, :system

#system (rw)

[ GitHub ]

  
# File 'lib/rexml/doctype.rb', line 242

attr_accessor :public, :system

Instance Method Details

#name

This method retrieves the name of the notation.

Method contributed by Henrik Martensson

[ GitHub ]

  
# File 'lib/rexml/doctype.rb', line 266

def name
  @name
end

#to_s

[ GitHub ]

  
# File 'lib/rexml/doctype.rb', line 251

def to_s
  notation = "<!NOTATION #{@name} #{@middle}"
  notation << " #{@public.inspect}" if @public
  notation << " #{@system.inspect}" if @system
  notation << ">"
  notation
end

#write(output, indent = -1 ))

[ GitHub ]

  
# File 'lib/rexml/doctype.rb', line 259

def write( output, indent=-1 )
  output << to_s
end