module GScholar::Citeable

Public Class Methods

included(base) click to toggle source
# 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

Public Instance Methods

__bib() click to toggle source
# File lib/gscholar/citation.rb, line 8
def __bib
  @__bib ||= BibTeX.parse(bibtex.to_s).first
end
author() click to toggle source
# File lib/gscholar/citation.rb, line 22
def author
  __bib.author.map(&:to_s)
end
citation(style) click to toggle source
# File lib/gscholar/citation.rb, line 14
def citation(style)
  CiteProc.process __bib.to_citeproc, :style => style
end
title() click to toggle source
# File lib/gscholar/citation.rb, line 18
def title
  __bib.title.to_s
end
year() click to toggle source
# File lib/gscholar/citation.rb, line 26
def year
  __bib.year.to_i
end