Class: Exa::Resources::Webset

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

Overview

Represents a webset from the Exa API

A webset is a collection of web entities (companies, people, etc.) discovered through searches, imports, and enrichments.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, object:, status:, external_id: nil, title: nil, searches: nil, imports: nil, enrichments: nil, monitors: nil, excludes: nil, metadata: nil, created_at: nil, updated_at: nil, items: nil) ⇒ Webset

Returns a new instance of Webset.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/exa/resources/webset.rb', line 26

def initialize(
  id:,
  object:,
  status:,
  external_id: nil,
  title: nil,
  searches: nil,
  imports: nil,
  enrichments: nil,
  monitors: nil,
  excludes: nil,
  metadata: nil,
  created_at: nil,
  updated_at: nil,
  items: nil
)
  super
  freeze
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def created_at
  @created_at
end

#enrichmentsObject

Returns the value of attribute enrichments

Returns:

  • (Object)

    the current value of enrichments



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def enrichments
  @enrichments
end

#excludesObject

Returns the value of attribute excludes

Returns:

  • (Object)

    the current value of excludes



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def excludes
  @excludes
end

#external_idObject

Returns the value of attribute external_id

Returns:

  • (Object)

    the current value of external_id



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def external_id
  @external_id
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def id
  @id
end

#importsObject

Returns the value of attribute imports

Returns:

  • (Object)

    the current value of imports



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def imports
  @imports
end

#itemsObject

Returns the value of attribute items

Returns:

  • (Object)

    the current value of items



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def items
  @items
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def 
  
end

#monitorsObject

Returns the value of attribute monitors

Returns:

  • (Object)

    the current value of monitors



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def monitors
  @monitors
end

#objectObject

Returns the value of attribute object

Returns:

  • (Object)

    the current value of object



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def object
  @object
end

#searchesObject

Returns the value of attribute searches

Returns:

  • (Object)

    the current value of searches



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def searches
  @searches
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def status
  @status
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



9
10
11
# File 'lib/exa/resources/webset.rb', line 9

def updated_at
  @updated_at
end

Instance Method Details

#idle?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/exa/resources/webset.rb', line 46

def idle?
  status == "idle"
end

#processing?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/exa/resources/webset.rb', line 50

def processing?
  status == "processing"
end

#to_hObject



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

def to_h
  {
    id: id,
    object: object,
    status: status,
    external_id: external_id,
    title: title,
    searches: searches,
    imports: imports,
    enrichments: enrichments,
    monitors: monitors,
    excludes: excludes,
    metadata: ,
    created_at: created_at,
    updated_at: updated_at,
    items: items
  }.compact
end