Class: Google::Scholar::ArticleSummary
- Inherits:
-
Object
- Object
- Google::Scholar::ArticleSummary
- Defined in:
- lib/google/scholar/article_summary.rb
Instance Method Summary collapse
- #authors ⇒ Object
- #citations ⇒ Object
- #full_article_url ⇒ Object
-
#initialize(doc) ⇒ ArticleSummary
constructor
A new instance of ArticleSummary.
- #publisher ⇒ Object
- #title ⇒ Object
- #year ⇒ Object
Constructor Details
#initialize(doc) ⇒ ArticleSummary
Returns a new instance of ArticleSummary.
4 5 6 |
# File 'lib/google/scholar/article_summary.rb', line 4 def initialize(doc) @document = doc end |
Instance Method Details
#authors ⇒ Object
10 11 12 |
# File 'lib/google/scholar/article_summary.rb', line 10 def @authors ||= @document.css("#col-title span:first").text end |
#citations ⇒ Object
16 17 18 |
# File 'lib/google/scholar/article_summary.rb', line 16 def citations @citations ||= @document.css("#col-citedby a:first").text.to_i end |
#full_article_url ⇒ Object
22 23 24 |
# File 'lib/google/scholar/article_summary.rb', line 22 def full_article_url @full_article_url ||= "#{Google::Scholar.google_url}#{@document.css("#col-title a:first").attr("href").text}" end |
#publisher ⇒ Object
13 14 15 |
# File 'lib/google/scholar/article_summary.rb', line 13 def publisher @publisher ||= @document.css("#col-title span:last").text end |
#title ⇒ Object
7 8 9 |
# File 'lib/google/scholar/article_summary.rb', line 7 def title @title ||= @document.css("#col-title a:first").text end |
#year ⇒ Object
19 20 21 |
# File 'lib/google/scholar/article_summary.rb', line 19 def year @year ||= @document.css("#col-year").text.to_i end |