Class: REXML::NotationDecl

Inherits:
Child 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.



253
254
255
256
257
258
259
# File 'lib/rexml/doctype.rb', line 253

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



252
253
254
# File 'lib/rexml/doctype.rb', line 252

def public
  @public
end

#systemObject

Returns the value of attribute system



252
253
254
# File 'lib/rexml/doctype.rb', line 252

def system
  @system
end

Instance Method Details

#nameObject

This method retrieves the name of the notation.

Method contributed by Henrik Martensson



283
284
285
# File 'lib/rexml/doctype.rb', line 283

def name
  @name
end

#to_sObject



261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/rexml/doctype.rb', line 261

def to_s
  c = nil
  c = parent.context if parent
  if c and c[:prologue_quote] == :apostrophe
    quote = "'"
  else
    quote = "\""
  end
  notation = "<!NOTATION #{@name} #{@middle}"
  notation << " #{quote}#{@public}#{quote}" if @public
  notation << " #{quote}#{@system}#{quote}" if @system
  notation << ">"
  notation
end

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



276
277
278
# File 'lib/rexml/doctype.rb', line 276

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