Class: Exa::Resources::WebsetEnrichment

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

Overview

Represents a webset enrichment from the Exa API

An enrichment extracts specific data from web entities in a webset.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, object:, status:, webset_id: nil, title: nil, description: nil, format: nil, options: nil, instructions: nil, metadata: nil, created_at: nil, updated_at: nil) ⇒ WebsetEnrichment

Returns a new instance of WebsetEnrichment.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/exa/resources/webset_enrichment.rb', line 23

def initialize(
  id:,
  object:,
  status:,
  webset_id: nil,
  title: nil,
  description: nil,
  format: nil,
  options: nil,
  instructions: nil,
  metadata: nil,
  created_at: nil,
  updated_at: nil
)
  super
  freeze
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



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

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



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

def description
  @description
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



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

def format
  @format
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



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

def id
  @id
end

#instructionsObject

Returns the value of attribute instructions

Returns:

  • (Object)

    the current value of instructions



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

def instructions
  @instructions
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



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

def 
  
end

#objectObject

Returns the value of attribute object

Returns:

  • (Object)

    the current value of object



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

def object
  @object
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



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

def options
  @options
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



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

def status
  @status
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



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

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



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

def updated_at
  @updated_at
end

#webset_idObject

Returns the value of attribute webset_id

Returns:

  • (Object)

    the current value of webset_id



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

def webset_id
  @webset_id
end

Instance Method Details

#completed?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/exa/resources/webset_enrichment.rb', line 49

def completed?
  status == "completed"
end

#pending?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/exa/resources/webset_enrichment.rb', line 41

def pending?
  status == "pending"
end

#running?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/exa/resources/webset_enrichment.rb', line 45

def running?
  status == "running"
end

#to_hObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/exa/resources/webset_enrichment.rb', line 53

def to_h
  {
    id: id,
    object: object,
    status: status,
    webset_id: webset_id,
    title: title,
    description: description,
    format: format,
    options: options,
    instructions: instructions,
    metadata: ,
    created_at: created_at,
    updated_at: updated_at
  }.compact
end