Class: Rafflesia::JobEvent

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/foundry/job_event.rb

Constant Summary collapse

HASH_ATTRS =
{
  attempt: :attempt,
  created_at: :created_at,
  details: :details,
  message: :message,
  sequence: :sequence,
  type: :type,
  worker_id: :worker_id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ JobEvent

Returns a new instance of JobEvent.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/foundry/job_event.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @attempt = hash[:attempt]
  @created_at = hash[:created_at]
  @details = hash[:details] || {}
  @message = hash[:message]
  @sequence = hash[:sequence]
  @type = hash[:type]
  @worker_id = hash[:worker_id]
end

Instance Attribute Details

#attemptObject

Returns the value of attribute attempt.



18
19
20
# File 'lib/rafflesia/foundry/job_event.rb', line 18

def attempt
  @attempt
end

#created_atObject

Returns the value of attribute created_at.



18
19
20
# File 'lib/rafflesia/foundry/job_event.rb', line 18

def created_at
  @created_at
end

#detailsObject

Returns the value of attribute details.



18
19
20
# File 'lib/rafflesia/foundry/job_event.rb', line 18

def details
  @details
end

#messageObject

Returns the value of attribute message.



18
19
20
# File 'lib/rafflesia/foundry/job_event.rb', line 18

def message
  @message
end

#sequenceObject

Returns the value of attribute sequence.



18
19
20
# File 'lib/rafflesia/foundry/job_event.rb', line 18

def sequence
  @sequence
end

#typeObject

Returns the value of attribute type.



18
19
20
# File 'lib/rafflesia/foundry/job_event.rb', line 18

def type
  @type
end

#worker_idObject

Returns the value of attribute worker_id.



18
19
20
# File 'lib/rafflesia/foundry/job_event.rb', line 18

def worker_id
  @worker_id
end