Class: Rafflesia::JobEventListData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::JobEventListData
- 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
-
#events ⇒ Object
Returns the value of attribute events.
-
#job_id ⇒ Object
Returns the value of attribute job_id.
-
#row_count ⇒ Object
Returns the value of attribute row_count.
Instance Method Summary collapse
-
#initialize(json) ⇒ JobEventListData
constructor
A new instance of JobEventListData.
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
#events ⇒ Object
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_id ⇒ Object
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_count ⇒ Object
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 |