Class: Moxml::ProcessingInstruction

Inherits:
Node
  • Object
show all
Defined in:
lib/moxml/processing_instruction.rb

Constant Summary

Constants inherited from Node

Node::TYPES

Instance Attribute Summary

Attributes inherited from Node

#context, #native

Instance Method Summary collapse

Methods inherited from Node

#==, #[], #add_child, #add_next_sibling, #add_previous_sibling, #at_xpath, #children, #clone, #document, #each_node, #find, #find_all, #first_child, #has_children?, #initialize, #last_child, #namespace, #namespaces, #next_sibling, #parent, #previous_sibling, #remove, #replace, #text, #to_xml, wrap, #xpath

Methods included from XmlUtils

#encode_entities, #normalize_xml_value, #validate_comment_content, #validate_declaration_encoding, #validate_declaration_standalone, #validate_declaration_version, #validate_element_name, #validate_pi_target, #validate_prefix, #validate_uri

Constructor Details

This class inherits a constructor from Moxml::Node

Instance Method Details

#contentObject



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

def content
  adapter.processing_instruction_content(@native)
end

#content=(new_content) ⇒ Object



23
24
25
# File 'lib/moxml/processing_instruction.rb', line 23

def content=(new_content)
  adapter.set_processing_instruction_content(@native, new_content.to_s)
end

#identifierString

Returns the primary identifier for this processing instruction (its target)

Returns:

  • (String)

    the PI target



15
16
17
# File 'lib/moxml/processing_instruction.rb', line 15

def identifier
  target
end

#targetObject



5
6
7
# File 'lib/moxml/processing_instruction.rb', line 5

def target
  adapter.processing_instruction_target(@native)
end

#target=(new_target) ⇒ Object



9
10
11
# File 'lib/moxml/processing_instruction.rb', line 9

def target=(new_target)
  adapter.set_node_name(@native, new_target.to_s)
end