Class: Rexle::Comment
- Inherits:
-
Object
- Object
- Rexle::Comment
- Defined in:
- lib/rexle.rb
Instance Method Summary collapse
- #add_element(e2) ⇒ Object
- #add_text(t) ⇒ Object
-
#initialize(val = '') ⇒ Comment
constructor
A new instance of Comment.
- #inspect ⇒ Object
- #print ⇒ Object
- #texts ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(val = '') ⇒ Comment
1350 1351 1352 1353 |
# File 'lib/rexle.rb', line 1350 def initialize(val='') @e = Element.new('_').add_text val @value = val end |
Instance Method Details
#add_element(e2) ⇒ Object
1355 1356 1357 |
# File 'lib/rexle.rb', line 1355 def add_element(e2) @e.add e2 end |
#add_text(t) ⇒ Object
1359 1360 1361 |
# File 'lib/rexle.rb', line 1359 def add_text(t) @e.add_text t end |
#inspect ⇒ Object
1363 1364 1365 |
# File 'lib/rexle.rb', line 1363 def inspect() @value end |
#print ⇒ Object
1367 1368 1369 |
# File 'lib/rexle.rb', line 1367 def print() "<!--%s-->" % @e.root.xpath('//./text()').join end |
#texts ⇒ Object
1371 1372 1373 |
# File 'lib/rexle.rb', line 1371 def texts() @e.texts end |
#to_s ⇒ Object
1375 1376 1377 |
# File 'lib/rexle.rb', line 1375 def to_s() @value end |