class GScraper::SponsoredAd
Attributes
title[R]
Title of the ad
url[R]
URL of the ad
Public Class Methods
new(title,url)
click to toggle source
Creates a new SponsoredAd
.
@param [String] title
The title of the ad.
@param [URI::HTTP] url
The URL of the ad.
# File lib/gscraper/sponsored_ad.rb, line 41 def initialize(title,url) @title = title @url = url end
Public Instance Methods
direct_link()
click to toggle source
The direct link of the ad.
@return [String]
The direct link.
# File lib/gscraper/sponsored_ad.rb, line 52 def direct_link @url.query_params['adurl'] || @url.query_params['q'] end
direct_url()
click to toggle source
The direct URI of the ad.
@return [URI::HTTP]
The direct URI.
# File lib/gscraper/sponsored_ad.rb, line 62 def direct_url URI(URI.escape(direct_link)) end
to_s()
click to toggle source
The title of the ad.
@return [String]
The title.
# File lib/gscraper/sponsored_ad.rb, line 72 def to_s @title.to_s end