Class: Oga::XML::ProcessingInstruction

Inherits:
CharacterNode show all
Defined in:
lib/oga/xml/processing_instruction.rb

Overview

Class used for storing information about a single processing instruction.

Direct Known Subclasses

XmlDeclaration

Instance Attribute Summary collapse

Attributes inherited from CharacterNode

#text

Attributes inherited from Node

#next, #node_set, #previous

Instance Method Summary collapse

Methods inherited from Node

#after, #before, #children, #children=, #each_ancestor, #html?, #next_element, #parent, #previous_element, #remove, #replace, #root_node, #xml?

Methods included from ToXML

#to_xml

Methods included from Traversal

#each_node

Constructor Details

#initialize(options = {}) ⇒ ProcessingInstruction

Returns a new instance of ProcessingInstruction

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :name (String)

    The name of the instruction.

See Also:

  • Oga::XML::ProcessingInstruction.[Oga[Oga::XML[Oga::XML::CharacterNode[Oga::XML::CharacterNode#initialize]


12
13
14
15
16
# File 'lib/oga/xml/processing_instruction.rb', line 12

def initialize(options = {})
  super

  @name = options[:name]
end

Instance Attribute Details

#nameString

Returns:

  • (String)


6
7
8
# File 'lib/oga/xml/processing_instruction.rb', line 6

def name
  @name
end

Instance Method Details

#inspectString

Returns:

  • (String)


19
20
21
# File 'lib/oga/xml/processing_instruction.rb', line 19

def inspect
  "ProcessingInstruction(name: #{name.inspect} text: #{text.inspect})"
end