Class: Rafflesia::JobEventListData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/jobs/job_event_list_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  events: :events,
  job_id: :job_id,
  row_count: :row_count
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ JobEventListData

Returns a new instance of JobEventListData.



19
20
21
22
23
24
25
# File 'lib/rafflesia/jobs/job_event_list_data.rb', line 19

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @events = (hash[:events] || []).map { |item| item ? Rafflesia::JobEvent.new(item) : nil }
  @job_id = hash[:job_id]
  @row_count = hash[:row_count]
end

Instance Attribute Details

#eventsObject

Returns the value of attribute events.



14
15
16
# File 'lib/rafflesia/jobs/job_event_list_data.rb', line 14

def events
  @events
end

#job_idObject

Returns the value of attribute job_id.



14
15
16
# File 'lib/rafflesia/jobs/job_event_list_data.rb', line 14

def job_id
  @job_id
end

#row_countObject

Returns the value of attribute row_count.



14
15
16
# File 'lib/rafflesia/jobs/job_event_list_data.rb', line 14

def row_count
  @row_count
end