Class: Exa::Resources::MonitorCollection

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

Overview

Represents a paginated list of monitors from the Exa API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, has_more: false, next_cursor: nil) ⇒ MonitorCollection

Returns a new instance of MonitorCollection.



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

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

Instance Attribute Details

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



6
7
8
# File 'lib/exa/resources/monitor_collection.rb', line 6

def data
  @data
end

#has_moreObject

Returns the value of attribute has_more

Returns:

  • (Object)

    the current value of has_more



6
7
8
# File 'lib/exa/resources/monitor_collection.rb', line 6

def has_more
  @has_more
end

#next_cursorObject

Returns the value of attribute next_cursor

Returns:

  • (Object)

    the current value of next_cursor



6
7
8
# File 'lib/exa/resources/monitor_collection.rb', line 6

def next_cursor
  @next_cursor
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
  data.empty?
end

#to_hObject



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

def to_h
  {
    data: data,
    has_more: has_more,
    next_cursor: next_cursor
  }
end