class Google_search_cmdline::Result
This class represents the results when executing Google_search_cmd#search, which is given by the enumerator.
Public Class Methods
new(args)
click to toggle source
# File lib/google_search_cmdline_result.rb, line 3 def initialize(args) @args = args raise "Invalid URL: '#{@args[:url]}'." if @args[:url].to_s.strip.empty? raise "Invalid title: '#{@args[:title]}'." if @args[:title].to_s.strip.empty? end
Public Instance Methods
title()
click to toggle source
Returns the title of the result.
# File lib/google_search_cmdline_result.rb, line 11 def title return @args[:title] end
url()
click to toggle source
Returns the URL of the result.
# File lib/google_search_cmdline_result.rb, line 16 def url return @args[:url] end