Class: Google::Apis::CustomsearchV1::Result

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/customsearch_v1/classes.rb,
lib/google/apis/customsearch_v1/representations.rb,
lib/google/apis/customsearch_v1/representations.rb

Overview

A custom search result.

Defined Under Namespace

Classes: Image, Label

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Result

Returns a new instance of Result.



224
225
226
# File 'lib/google/apis/customsearch_v1/classes.rb', line 224

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cache_idString

Indicates the ID of Google's cached version of the search result. Corresponds to the JSON property cacheId

Returns:

  • (String)


149
150
151
# File 'lib/google/apis/customsearch_v1/classes.rb', line 149

def cache_id
  @cache_id
end

An abridged version of this search result’s URL, e.g. www.example.com. Corresponds to the JSON property displayLink

Returns:

  • (String)


154
155
156
# File 'lib/google/apis/customsearch_v1/classes.rb', line 154

def display_link
  @display_link
end

#file_formatString

The file format of the search result. Corresponds to the JSON property fileFormat

Returns:

  • (String)


159
160
161
# File 'lib/google/apis/customsearch_v1/classes.rb', line 159

def file_format
  @file_format
end

#formatted_urlString

The URL displayed after the snippet for each search result. Corresponds to the JSON property formattedUrl

Returns:

  • (String)


164
165
166
# File 'lib/google/apis/customsearch_v1/classes.rb', line 164

def formatted_url
  @formatted_url
end

#html_formatted_urlString

The HTML-formatted URL displayed after the snippet for each search result. Corresponds to the JSON property htmlFormattedUrl

Returns:

  • (String)


169
170
171
# File 'lib/google/apis/customsearch_v1/classes.rb', line 169

def html_formatted_url
  @html_formatted_url
end

#html_snippetString

The snippet of the search result, in HTML. Corresponds to the JSON property htmlSnippet

Returns:

  • (String)


174
175
176
# File 'lib/google/apis/customsearch_v1/classes.rb', line 174

def html_snippet
  @html_snippet
end

#html_titleString

The title of the search result, in HTML. Corresponds to the JSON property htmlTitle

Returns:

  • (String)


179
180
181
# File 'lib/google/apis/customsearch_v1/classes.rb', line 179

def html_title
  @html_title
end

#imageGoogle::Apis::CustomsearchV1::Result::Image

Image belonging to a custom search result. Corresponds to the JSON property image



184
185
186
# File 'lib/google/apis/customsearch_v1/classes.rb', line 184

def image
  @image
end

#kindString

A unique identifier for the type of current object. For this API, it is customsearch#result. Corresponds to the JSON property kind

Returns:

  • (String)


190
191
192
# File 'lib/google/apis/customsearch_v1/classes.rb', line 190

def kind
  @kind
end

#labelsArray<Google::Apis::CustomsearchV1::Result::Label>

Encapsulates all information about refinement labels. Corresponds to the JSON property labels



195
196
197
# File 'lib/google/apis/customsearch_v1/classes.rb', line 195

def labels
  @labels
end

The full URL to which the search result is pointing, e.g. http://www.example. com/foo/bar. Corresponds to the JSON property link

Returns:

  • (String)


201
202
203
# File 'lib/google/apis/customsearch_v1/classes.rb', line 201

def link
  @link
end

#mimeString

The MIME type of the search result. Corresponds to the JSON property mime

Returns:

  • (String)


206
207
208
# File 'lib/google/apis/customsearch_v1/classes.rb', line 206

def mime
  @mime
end

#pagemapHash<String,Object>

Contains PageMap information for this search result. Corresponds to the JSON property pagemap

Returns:

  • (Hash<String,Object>)


212
213
214
# File 'lib/google/apis/customsearch_v1/classes.rb', line 212

def pagemap
  @pagemap
end

#snippetString

The snippet of the search result, in plain text. Corresponds to the JSON property snippet

Returns:

  • (String)


217
218
219
# File 'lib/google/apis/customsearch_v1/classes.rb', line 217

def snippet
  @snippet
end

#titleString

The title of the search result, in plain text. Corresponds to the JSON property title

Returns:

  • (String)


222
223
224
# File 'lib/google/apis/customsearch_v1/classes.rb', line 222

def title
  @title
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/google/apis/customsearch_v1/classes.rb', line 229

def update!(**args)
  @cache_id = args[:cache_id] if args.key?(:cache_id)
  @display_link = args[:display_link] if args.key?(:display_link)
  @file_format = args[:file_format] if args.key?(:file_format)
  @formatted_url = args[:formatted_url] if args.key?(:formatted_url)
  @html_formatted_url = args[:html_formatted_url] if args.key?(:html_formatted_url)
  @html_snippet = args[:html_snippet] if args.key?(:html_snippet)
  @html_title = args[:html_title] if args.key?(:html_title)
  @image = args[:image] if args.key?(:image)
  @kind = args[:kind] if args.key?(:kind)
  @labels = args[:labels] if args.key?(:labels)
  @link = args[:link] if args.key?(:link)
  @mime = args[:mime] if args.key?(:mime)
  @pagemap = args[:pagemap] if args.key?(:pagemap)
  @snippet = args[:snippet] if args.key?(:snippet)
  @title = args[:title] if args.key?(:title)
end