Sha256: 9e9aed87537b7b99d48db8b9b541d775ca6f1065c4698ea4a7215b93743c08b2

Contents?: true

Size: 745 Bytes

Versions: 2

Compression:

Stored size: 745 Bytes

Contents

module Google
  module Scholar
    class ArticleSummary
      def initialize(doc)
        @document = doc
      end
      def title
        @title ||= @document.css("#col-title a:first").text
      end
      def authors
        @authors ||= @document.css("#col-title span:first").text
      end
      def publisher
        @publisher ||= @document.css("#col-title span:last").text
      end
      def citations
        @citations ||= @document.css("#col-citedby a:first").text.to_i
      end
      def year
        @year ||= @document.css("#col-year").text.to_i
      end
      def full_article_url
        @full_article_url ||= "#{Google::Scholar.google_url}#{@document.css("#col-title a:first").attr("href").text}"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
google-scholar-0.0.2 lib/google/scholar/article_summary.rb
google-scholar-0.0.1 lib/google/scholar/article_summary.rb