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.



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

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

Instance Method Details

#add_element(e2) ⇒ Object



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

def add_element(e2)
  @e.add e2
end

#add_text(t) ⇒ Object



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

def add_text(t)
  @e.add_text t
end

#inspectObject



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

def inspect()
  @value
end


1392
1393
1394
# File 'lib/rexle.rb', line 1392

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

#textsObject



1396
1397
1398
# File 'lib/rexle.rb', line 1396

def texts()
  @e.texts
end

#to_sObject



1400
1401
1402
# File 'lib/rexle.rb', line 1400

def to_s()
  @value
end