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.



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

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

Instance Method Details

#add_element(e2) ⇒ Object



1368
1369
1370
# File 'lib/rexle.rb', line 1368

def add_element(e2)
  @e.add e2
end

#add_text(t) ⇒ Object



1372
1373
1374
# File 'lib/rexle.rb', line 1372

def add_text(t)
  @e.add_text t
end

#inspectObject



1376
1377
1378
# File 'lib/rexle.rb', line 1376

def inspect()
  @value
end


1380
1381
1382
# File 'lib/rexle.rb', line 1380

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

#textsObject



1384
1385
1386
# File 'lib/rexle.rb', line 1384

def texts()
  @e.texts
end

#to_sObject



1388
1389
1390
# File 'lib/rexle.rb', line 1388

def to_s()
  @value
end