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.



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

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

Instance Method Details

#add_element(e2) ⇒ Object



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

def add_element(e2)
  @e.add e2
end

#add_text(t) ⇒ Object



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

def add_text(t)
  @e.add_text t
end

#inspectObject



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

def inspect()
  @value
end


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

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

#textsObject



1370
1371
1372
# File 'lib/rexle.rb', line 1370

def texts()
  @e.texts
end

#to_sObject



1374
1375
1376
# File 'lib/rexle.rb', line 1374

def to_s()
  @value
end