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)


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

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

Instance Method Details

#write_to(out = "") ⇒ Object



61
62
63
# File 'lib/eim_xml.rb', line 61

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