Class: Google::Scholar::ArticleSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/google/scholar/article_summary.rb

Instance Method Summary collapse

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

#authorsObject



10
11
12
# File 'lib/google/scholar/article_summary.rb', line 10

def authors
  @authors ||= @document.css("#col-title span:first").text
end

#citationsObject



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_urlObject



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

#publisherObject



13
14
15
# File 'lib/google/scholar/article_summary.rb', line 13

def publisher
  @publisher ||= @document.css("#col-title span:last").text
end

#titleObject



7
8
9
# File 'lib/google/scholar/article_summary.rb', line 7

def title
  @title ||= @document.css("#col-title a:first").text
end

#yearObject



19
20
21
# File 'lib/google/scholar/article_summary.rb', line 19

def year
  @year ||= @document.css("#col-year").text.to_i
end