Class: Exa::Resources::Monitor

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

Overview

Represents a webset monitor that automates updates on a schedule

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#behaviorObject

Returns the value of attribute behavior

Returns:

  • (Object)

    the current value of behavior



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

def behavior
  @behavior
end

#cadenceObject

Returns the value of attribute cadence

Returns:

  • (Object)

    the current value of cadence



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

def cadence
  @cadence
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



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

def created_at
  @created_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



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

def id
  @id
end

#objectObject

Returns the value of attribute object

Returns:

  • (Object)

    the current value of object



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

def object
  @object
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



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

def status
  @status
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



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

def updated_at
  @updated_at
end

#webset_idObject

Returns the value of attribute webset_id

Returns:

  • (Object)

    the current value of webset_id



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

def webset_id
  @webset_id
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/exa/resources/monitor.rb', line 26

def active?
  status == "active"
end

#freezeObject



15
16
17
18
19
20
# File 'lib/exa/resources/monitor.rb', line 15

def freeze
  super
  cadence.freeze if cadence
  behavior.freeze if behavior
  self
end

#paused?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/exa/resources/monitor.rb', line 30

def paused?
  status == "paused"
end

#pending?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/exa/resources/monitor.rb', line 22

def pending?
  status == "pending"
end

#to_hObject



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/exa/resources/monitor.rb', line 34

def to_h
  {
    id: id,
    object: object,
    status: status,
    webset_id: webset_id,
    cadence: cadence,
    behavior: behavior,
    created_at: created_at,
    updated_at: updated_at
  }.compact
end