Class: BibTeX::Preamble
- Includes:
- Replaceable
- Defined in:
- lib/bibtex/elements.rb
Overview
Represents a @preamble object.
In BibTeX an @preamble object contains a single string literal, a single constant, or a concatenation of string literals and constants.
Instance Attribute Summary
Attributes included from Replaceable
Attributes inherited from Element
Instance Method Summary collapse
-
#content ⇒ Object
Returns a string representation of the @preamble’s content.
-
#initialize(value = '') ⇒ Preamble
constructor
Creates a new instance.
-
#to_s(options = {}) ⇒ Object
Returns a string representation of the @preamble object.
Methods included from Replaceable
Methods inherited from Element
#<=>, #added_to_bibliography, #has_type?, #join, #matches?, #meets?, parse, #removed_from_bibliography, #replace, #to_hash, #to_json, #to_xml, #to_yaml, #type
Constructor Details
Instance Method Details
#content ⇒ Object
Returns a string representation of the @preamble’s content.
243 244 245 |
# File 'lib/bibtex/elements.rb', line 243 def content @value.to_s(:quotes => '"') end |
#to_s(options = {}) ⇒ Object
Returns a string representation of the @preamble object
248 249 250 |
# File 'lib/bibtex/elements.rb', line 248 def to_s( = {}) "@preamble{ #{content} }" end |