Class: Bibtex::Field
- Inherits:
-
Object
- Object
- Bibtex::Field
- Defined in:
- lib/bibtex/field.rb
Overview
A field within an entry E.g. author = Foo
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ Field
constructor
A new instance of Field.
- #to_s ⇒ Object
Constructor Details
#initialize(key, value) ⇒ Field
Returns a new instance of Field.
7 8 9 10 |
# File 'lib/bibtex/field.rb', line 7 def initialize(key, value) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/bibtex/field.rb', line 5 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/bibtex/field.rb', line 5 def value @value end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/bibtex/field.rb', line 12 def to_s "#{@key} = {#{@value}}" end |