Class: Exa::Resources::ResearchList

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, has_more:, next_cursor: nil) ⇒ ResearchList

Returns a new instance of ResearchList.



4
5
6
7
# File 'lib/exa/resources/research_list.rb', line 4

def initialize(data:, has_more:, next_cursor: nil)
  super
  freeze
end

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



3
4
5
# File 'lib/exa/resources/research_list.rb', line 3

def data
  @data
end

#has_moreObject

Returns the value of attribute has_more

Returns:

  • (Object)

    the current value of has_more



3
4
5
# File 'lib/exa/resources/research_list.rb', line 3

def has_more
  @has_more
end

#next_cursorObject

Returns the value of attribute next_cursor

Returns:

  • (Object)

    the current value of next_cursor



3
4
5
# File 'lib/exa/resources/research_list.rb', line 3

def next_cursor
  @next_cursor
end

Instance Method Details

#to_hObject



9
10
11
12
13
14
15
# File 'lib/exa/resources/research_list.rb', line 9

def to_h
  {
    data: data.map { |item| item.respond_to?(:to_h) ? item.to_h : item },
    has_more: has_more,
    next_cursor: next_cursor
  }
end