Class: EimXML::Comment

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

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Comment

Returns a new instance of Comment.

Raises:

  • (ArgumentError)


50
51
52
53
# File 'lib/eim_xml.rb', line 50

def initialize(text)
	raise ArgumentError, "Can not include '--'" if text =~ /--/
	@text = text
end

Instance Method Details

#write_to(out = "") ⇒ Object



55
56
57
# File 'lib/eim_xml.rb', line 55

def write_to(out="")
	out << "<!-- #{@text} -->"
end