Class: REXML::Instruction
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
| Class Chain: 
          self,
           Child | |
| Instance Chain: | |
| Inherits: | REXML::Child 
 | 
| Defined in: | lib/rexml/instruction.rb | 
Overview
Represents an XML Instruction; IE, <? … ?> TODO: Add parent arg (3rd arg) to constructor
Constant Summary
- 
    START =
    
 # File 'lib/rexml/instruction.rb', line 10"<?"
- 
    STOP =
    
 # File 'lib/rexml/instruction.rb', line 11"?>"
Class Method Summary
- 
    
      .new(target, content = nil)  ⇒ Instruction 
    
    constructor
    Constructs a new Instructionthe target of this instruction is set to this.
Child - Inherited
| .new | Constructor. | 
Instance Attribute Summary
- 
    
      #content  
    
    rw
    target is the “name” of the Instruction; IE, the “tag” in <?tag …?> content is everything else. 
- 
    
      #target  
    
    rw
    target is the “name” of the Instruction; IE, the “tag” in <?tag …?> content is everything else. 
Child - Inherited
| #next_sibling | Alias for Node#next_sibling_node. | 
| #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 | Alias for Node#previous_sibling_node. | 
| #previous_sibling= | Sets the previous sibling of this child. | 
Node - Included
Instance Method Summary
- 
    
      #==(other)  ⇒ Object 
    
    of the other matches the target and content of this object. 
- #clone
- #inspect
- #node_type
- 
    
      #write(writer, indent = -1,, transitive = false, ie_hack = false)  
    
    DEPRECATED See the rexml/formatters package. 
Child - Inherited
| #bytes | This doesn’t yet handle encodings. | 
| #document | 
 | 
| #remove | Removes this child from the parent. | 
| #replace_with | Replaces this object with another object. | 
Node - Included
| #each_recursive | Visit all subnodes of  | 
| #find_first_recursive | Find (and return) first subnode (recursively) for which the block evaluates to true. | 
| #indent, | |
| #index_in_parent | Returns the position that  | 
| #next_sibling_node, #previous_sibling_node, | |
| #to_s | 
 | 
Constructor Details
    .new(target, content = nil)  ⇒ Instruction 
  
# File 'lib/rexml/instruction.rb', line 25
def initialize(target, content=nil) case target when String super() @target = target @content = content when Instruction super(content) @target = target.target @content = target.content else = "processing instruction target must be String or REXML::Instruction: " << "<#{target.inspect}>" raise ArgumentError, end @content.strip! if @content end
Instance Attribute Details
#content (rw)
target is the “name” of the Instruction; IE, the “tag” in <?tag …?> content is everything else.
# File 'lib/rexml/instruction.rb', line 15
attr_accessor :target, :content
#target (rw)
target is the “name” of the Instruction; IE, the “tag” in <?tag …?> content is everything else.
# File 'lib/rexml/instruction.rb', line 15
attr_accessor :target, :content
Instance Method Details
    #==(other)  ⇒ Object 
  
of the other matches the target and content of this object.
#clone
[ GitHub ]# File 'lib/rexml/instruction.rb', line 44
def clone Instruction.new self end
#inspect
[ GitHub ]# File 'lib/rexml/instruction.rb', line 75
def inspect "<?p-i #{target} ...?>" end
#node_type
[ GitHub ]# File 'lib/rexml/instruction.rb', line 71
def node_type :processing_instruction end
#write(writer, indent = -1,, transitive = false, ie_hack = false)
DEPRECATED
See the rexml/formatters package