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.



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

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

Instance Method Details

#add_element(e2) ⇒ Object



1352
1353
1354
# File 'lib/rexle.rb', line 1352

def add_element(e2)
  @e.add e2
end

#add_text(t) ⇒ Object



1356
1357
1358
# File 'lib/rexle.rb', line 1356

def add_text(t)
  @e.add_text t
end

#inspectObject



1360
1361
1362
# File 'lib/rexle.rb', line 1360

def inspect()
  @value
end


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

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

#textsObject



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

def texts()
  @e.texts
end

#to_sObject



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

def to_s()
  @value
end