Class: GScholar::Paper
- Inherits:
-
Object
- Object
- GScholar::Paper
- Includes:
- Citeable
- Defined in:
- lib/gscholar/paper.rb
Constant Summary collapse
- CITATION_PER_PAGE =
20
Instance Attribute Summary collapse
-
#bibtex ⇒ Object
(also: #to_s)
readonly
Returns the value of attribute bibtex.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #citations(range = nil) ⇒ Object
- #cited ⇒ Object
-
#initialize(id) ⇒ Paper
constructor
A new instance of Paper.
Methods included from Citeable
#author, #citation, included, #title, #year
Constructor Details
Instance Attribute Details
#bibtex ⇒ Object (readonly) Also known as: to_s
Returns the value of attribute bibtex.
7 8 9 |
# File 'lib/gscholar/paper.rb', line 7 def bibtex @bibtex end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/gscholar/paper.rb', line 7 def id @id end |
Instance Method Details
#citations(range = nil) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/gscholar/paper.rb', line 21 def citations(range = nil) rst = [] while true links = Utils.fetch(citations_url(rst.size, range)).links_with(:text => "Import into BibTeX") return rst if links.empty? rst += links.map {|link| Citation.new(link.href[/info:([^:]+):/, 1]) } end end |