Class: Oga::XML::ProcessingInstruction
- Inherits:
-
CharacterNode
- Object
- Node
- CharacterNode
- Oga::XML::ProcessingInstruction
- Defined in:
- lib/oga/xml/processing_instruction.rb
Overview
Class used for storing information about a single processing instruction.
Instance Attribute Summary collapse
Attributes inherited from CharacterNode
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ProcessingInstruction
constructor
A new instance of ProcessingInstruction.
- #inspect ⇒ String
- #to_xml ⇒ String
Methods inherited from Node
#after, #before, #children, #children=, #html?, #next, #next_element, #parent, #previous, #previous_element, #remove, #replace, #root_node, #xml?
Methods included from Traversal
Constructor Details
#initialize(options = {}) ⇒ ProcessingInstruction
Returns a new instance of ProcessingInstruction.
16 17 18 19 20 |
# File 'lib/oga/xml/processing_instruction.rb', line 16 def initialize( = {}) super @name = [:name] end |
Instance Attribute Details
#name ⇒ String
8 9 10 |
# File 'lib/oga/xml/processing_instruction.rb', line 8 def name @name end |
Instance Method Details
#inspect ⇒ String
32 33 34 |
# File 'lib/oga/xml/processing_instruction.rb', line 32 def inspect "ProcessingInstruction(name: #{name.inspect} text: #{text.inspect})" end |
#to_xml ⇒ String
25 26 27 |
# File 'lib/oga/xml/processing_instruction.rb', line 25 def to_xml "<?#{name}#{text}?>" end |