Module: GScholar::Citeable
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/gscholar/citation.rb', line 6 def self.included(base) base.class_exec do def __bib @__bib ||= BibTeX.parse(bibtex.to_s).first end end end |
Instance Method Details
#author ⇒ Object
22 23 24 |
# File 'lib/gscholar/citation.rb', line 22 def __bib..map(&:to_s) end |
#citation(style) ⇒ Object
14 15 16 |
# File 'lib/gscholar/citation.rb', line 14 def citation(style) CiteProc.process __bib.to_citeproc, :style => style end |
#title ⇒ Object
18 19 20 |
# File 'lib/gscholar/citation.rb', line 18 def title __bib.title.to_s end |
#year ⇒ Object
26 27 28 |
# File 'lib/gscholar/citation.rb', line 26 def year __bib.year.to_i end |