Class: Tavily::Image

Inherits:
Object show all
Defined in:
lib/tavily/responses.rb

Overview

An image associated with a search result. Tavily returns images either as bare URL strings or as objects with a description; this normalizes both.

Instance Attribute Summary

Attributes inherited from Object

#attributes

Instance Method Summary collapse

Methods inherited from Object

#==, #[], attribute, #dig, #hash, #initialize, #inspect, #key?, #to_h

Constructor Details

This class inherits a constructor from Tavily::Object

Instance Method Details

#descriptionString?

Returns generated description (when image descriptions requested).

Returns:

  • (String, nil)

    generated description (when image descriptions requested).



18
# File 'lib/tavily/responses.rb', line 18

attribute :description

#urlString?

Returns image URL.

Returns:

  • (String, nil)

    image URL.



16
# File 'lib/tavily/responses.rb', line 16

attribute :url