Class: Rexle::Comment

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

Instance Method Summary collapse

Constructor Details

#initialize(val = '') ⇒ Comment



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

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

Instance Method Details

#add_element(e2) ⇒ Object



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

def add_element(e2)
  @e.add e2
end

#add_text(t) ⇒ Object



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

def add_text(t)
  @e.add_text t
end

#inspectObject



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

def inspect()
  @value
end


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

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

#textsObject



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

def texts()
  @e.texts
end

#to_sObject



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

def to_s()
  @value
end