Class: Bibtex::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/bibtex/field.rb

Overview

A field within an entry E.g. author = Foo

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/bibtex/field.rb', line 5

def key
  @key
end

#valueObject (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_sObject



12
13
14
# File 'lib/bibtex/field.rb', line 12

def to_s
  "#{@key} = {#{@value}}"
end