Class: BibTeX::Comment
Overview
Represents a @comment object.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
- #content ⇒ Object
- #content=(content) ⇒ Object
-
#initialize(content = '') ⇒ Comment
constructor
A new instance of Comment.
- #to_s ⇒ Object
Methods inherited from Element
#added_to_bibliography, #removed_from_bibliography, #to_hash, #to_json, #to_xml, #to_yaml
Constructor Details
#initialize(content = '') ⇒ Comment
Returns a new instance of Comment.
229 230 231 |
# File 'lib/bibtex/elements.rb', line 229 def initialize(content='') self.content = content end |
Instance Method Details
#content ⇒ Object
238 239 240 |
# File 'lib/bibtex/elements.rb', line 238 def content @content end |
#content=(content) ⇒ Object
233 234 235 236 |
# File 'lib/bibtex/elements.rb', line 233 def content=(content) raise(ArgumentError, "BibTeX::#{self.class.name} content must be of type String; was: #{content.class.name}.") unless content.kind_of?(::String) @content = content end |
#to_s ⇒ Object
242 243 244 |
# File 'lib/bibtex/elements.rb', line 242 def to_s ['@comment{ ',content,'}'].join end |