Class: XmlParsable::Elements::XmlElement::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/xmlparsable/elements/xml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, parent) ⇒ Comment

Returns a new instance of Comment.



70
71
72
# File 'lib/xmlparsable/elements/xml.rb', line 70

def initialize(text, parent)
  @text, @parent = text, parent
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent.



68
69
70
# File 'lib/xmlparsable/elements/xml.rb', line 68

def parent
  @parent
end

#textObject (readonly)

Returns the value of attribute text.



68
69
70
# File 'lib/xmlparsable/elements/xml.rb', line 68

def text
  @text
end

Instance Method Details

#to_s(buffer = "") ⇒ Object



74
75
76
# File 'lib/xmlparsable/elements/xml.rb', line 74

def to_s(buffer = "")
  buffer << "<!--" << @text << "-->"
end