Class: REXML::NotationDecl

Inherits:
Child
  • Object
show all
Defined in:
lib/rexml/doctype.rb

Instance Attribute Summary collapse

Attributes inherited from Child

#parent

Instance Method Summary collapse

Methods inherited from Child

#bytes, #document, #next_sibling=, #previous_sibling=, #remove, #replace_with

Methods included from Node

#each_recursive, #find_first_recursive, #indent, #index_in_parent, #next_sibling_node, #parent?, #previous_sibling_node

Constructor Details

#initialize(name, middle, pub, sys) ⇒ NotationDecl

Returns a new instance of NotationDecl.



282
283
284
285
286
287
288
# File 'lib/rexml/doctype.rb', line 282

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

Instance Attribute Details

#publicObject

Returns the value of attribute public.



281
282
283
# File 'lib/rexml/doctype.rb', line 281

def public
  @public
end

#systemObject

Returns the value of attribute system.



281
282
283
# File 'lib/rexml/doctype.rb', line 281

def system
  @system
end

Instance Method Details

#nameObject

This method retrieves the name of the notation.

Method contributed by Henrik Martensson



307
308
309
# File 'lib/rexml/doctype.rb', line 307

def name
  @name
end

#to_sObject



290
291
292
293
294
295
296
297
298
# File 'lib/rexml/doctype.rb', line 290

def to_s
  context = nil
  context = parent.context if parent
  notation = "<!NOTATION #{@name}"
  reference_writer = ReferenceWriter.new(@middle, @public, @system, context)
  reference_writer.write(notation)
  notation << ">"
  notation
end

#write(output, indent = -1 )) ⇒ Object



300
301
302
# File 'lib/rexml/doctype.rb', line 300

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