Class: BibTeX::Entry
- Inherits:
-
Object
- Object
- BibTeX::Entry
- Defined in:
- lib/btparse-ruby/BibTeX.rb,
ext/btparse-ruby/btparse_ruby.c
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
6 7 8 |
# File 'lib/btparse-ruby/BibTeX.rb', line 6 def fields @fields end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/btparse-ruby/BibTeX.rb', line 6 def key @key end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/btparse-ruby/BibTeX.rb', line 6 def type @type end |
Instance Method Details
#to_s ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/btparse-ruby/BibTeX.rb', line 8 def to_s str = "@#{type}{#{key},\n" fields.each do |name, value| str += "\t#{BibTeX.purify(name)} = " if name == "author" str += BibTeX.(value).inspect else str += "'" + BibTeX.purify(value) + "'" end str += "\n" end str += "}" end |