Class: Exa::Responses::MonitorRun

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/exa/responses/monitor_response.rb

Class Method Summary collapse

Class Method Details

.from_hash(hash) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/exa/responses/monitor_response.rb', line 50

def self.from_hash(hash)
  sym = Helpers.symbolize_keys(hash)
  new(
    id: sym[:id],
    monitor_id: sym[:monitorId],
    status: sym[:status],
    run_type: sym[:type] || sym[:runType],
    started_at: sym[:startedAt],
    finished_at: sym[:finishedAt],
    raw: sym
  )
end