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)


47
48
49
50
51
# File 'lib/eim_xml.rb', line 47

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

  @text = text
end

Instance Method Details

#write_to(out = '') ⇒ Object



53
54
55
# File 'lib/eim_xml.rb', line 53

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