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, #digest, #has_type?, #inspect, #join, #matches?, #meets?, #meets_all?, #meets_any?, #names, parse, #removed_from_bibliography, #replace, #to_hash, #to_json, #to_xml, #to_yaml, #type, #values_at
Constructor Details
Instance Method Details
#content ⇒ Object
Returns a string representation of the @preamble’s content.
345 346 347 |
# File 'lib/bibtex/elements.rb', line 345 def content @value.to_s(quotes: '"') end |
#to_s(_options = {}) ⇒ Object
Returns a string representation of the @preamble object
350 351 352 |
# File 'lib/bibtex/elements.rb', line 350 def to_s( = {}) "@preamble{ #{content} }\n" end |