Class: Rexle::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/rexle.rb

Instance Method Summary collapse

Constructor Details

#initialize(val = '') ⇒ Comment

Returns a new instance of Comment.



1341
1342
1343
1344
# File 'lib/rexle.rb', line 1341

def initialize(val='')
  @e = Element.new('_').add_text val
  @value = val
end

Instance Method Details

#add_element(e2) ⇒ Object



1346
1347
1348
# File 'lib/rexle.rb', line 1346

def add_element(e2)
  @e.add e2
end

#add_text(t) ⇒ Object



1350
1351
1352
# File 'lib/rexle.rb', line 1350

def add_text(t)
  @e.add_text t
end

#inspectObject



1354
1355
1356
# File 'lib/rexle.rb', line 1354

def inspect()
  @value
end


1358
1359
1360
# File 'lib/rexle.rb', line 1358

def print()
  "<!--%s-->" % @e.root.xpath('//./text()').join
end

#textsObject



1362
1363
1364
# File 'lib/rexle.rb', line 1362

def texts()
  @e.texts
end

#to_sObject



1366
1367
1368
# File 'lib/rexle.rb', line 1366

def to_s()
  @value
end