Class: HardCiter::BibTexLibrary

Inherits:
Object
  • Object
show all
Defined in:
lib/hardciter/library.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ BibTexLibrary

Returns a new instance of BibTexLibrary.



7
8
9
# File 'lib/hardciter/library.rb', line 7

def initialize(path=nil)
  load_from_file(path) if path
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



19
20
21
# File 'lib/hardciter/library.rb', line 19

def method_missing(method, *args, &block)
  @bibtex.send method, *args, &block
end

Instance Attribute Details

#bibtexObject

Returns the value of attribute bibtex.



5
6
7
# File 'lib/hardciter/library.rb', line 5

def bibtex
  @bibtex
end

Instance Method Details

#get_entry(key) ⇒ Object



15
16
17
# File 'lib/hardciter/library.rb', line 15

def get_entry(key)
  @bibtex[key]
end

#load_from_file(path) ⇒ Object



11
12
13
# File 'lib/hardciter/library.rb', line 11

def load_from_file(path)
  @bibtex = BibTeX.open(path)
end