Class: Moxml::Comment
- Inherits:
-
Node
- Object
- Node
- Moxml::Comment
show all
- Defined in:
- lib/moxml/comment.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(content_or_native = nil) ⇒ Comment
Returns a new instance of Comment.
3
4
5
6
7
8
9
10
|
# File 'lib/moxml/comment.rb', line 3
def initialize(content_or_native = nil)
case content_or_native
when String
super(adapter.(nil, content_or_native))
else
super(content_or_native)
end
end
|
Instance Method Details
#blank? ⇒ Boolean
21
22
23
|
# File 'lib/moxml/comment.rb', line 21
def blank?
content.strip.empty?
end
|
25
26
27
|
# File 'lib/moxml/comment.rb', line 25
def
true
end
|
#content ⇒ Object
12
13
14
|
# File 'lib/moxml/comment.rb', line 12
def content
adapter.(native)
end
|
#content=(text) ⇒ Object
16
17
18
19
|
# File 'lib/moxml/comment.rb', line 16
def content=(text)
adapter.(native, text)
self
end
|