Class: Moxml::ProcessingInstruction
- Inherits:
-
Node
- Object
- Node
- Moxml::ProcessingInstruction
show all
- Defined in:
- lib/moxml/processing_instruction.rb
Instance Attribute Summary
Attributes inherited from Node
#native
Instance Method Summary
collapse
Methods inherited from Node
#add_next_sibling, #add_previous_sibling, #children, #column, #inner_html, #inner_html=, #line, #next_sibling, #outer_html, #parent, #path, #previous_sibling, #remove, #replace, #text, #text=, wrap
Constructor Details
#initialize(target_or_native = nil, content = nil) ⇒ ProcessingInstruction
Returns a new instance of ProcessingInstruction.
3
4
5
6
7
8
9
10
|
# File 'lib/moxml/processing_instruction.rb', line 3
def initialize(target_or_native = nil, content = nil)
case target_or_native
when String
super(adapter.create_processing_instruction(nil, target_or_native, content))
else
super(target_or_native)
end
end
|
Instance Method Details
#blank? ⇒ Boolean
30
31
32
|
# File 'lib/moxml/processing_instruction.rb', line 30
def blank?
content.strip.empty?
end
|
#content ⇒ Object
21
22
23
|
# File 'lib/moxml/processing_instruction.rb', line 21
def content
adapter.processing_instruction_content(native)
end
|
#content=(new_content) ⇒ Object
25
26
27
28
|
# File 'lib/moxml/processing_instruction.rb', line 25
def content=(new_content)
adapter.set_processing_instruction_content(native, new_content)
self
end
|
#processing_instruction? ⇒ Boolean
34
35
36
|
# File 'lib/moxml/processing_instruction.rb', line 34
def processing_instruction?
true
end
|
#target ⇒ Object
12
13
14
|
# File 'lib/moxml/processing_instruction.rb', line 12
def target
adapter.processing_instruction_target(native)
end
|
#target=(new_target) ⇒ Object
16
17
18
19
|
# File 'lib/moxml/processing_instruction.rb', line 16
def target=(new_target)
adapter.set_processing_instruction_target(native, new_target)
self
end
|