Class: Exa::Resources::WebsetEnrichmentCollection

Inherits:
Struct
  • Object
show all
Defined in:
lib/exa/resources/webset_enrichment_collection.rb

Overview

Represents a list of enrichments for a webset from the Exa API

This class wraps the JSON response from the GET /websets/v0/websets/id/enrichments endpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:) ⇒ WebsetEnrichmentCollection

Returns a new instance of WebsetEnrichmentCollection.



12
13
14
15
# File 'lib/exa/resources/webset_enrichment_collection.rb', line 12

def initialize(data:)
  super
  freeze
end

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



8
9
10
# File 'lib/exa/resources/webset_enrichment_collection.rb', line 8

def data
  @data
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/exa/resources/webset_enrichment_collection.rb', line 17

def empty?
  data.empty?
end

#to_hObject



21
22
23
24
25
# File 'lib/exa/resources/webset_enrichment_collection.rb', line 21

def to_h
  {
    data: data
  }
end