Class: Rafflesia::JobListData

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

Constant Summary collapse

HASH_ATTRS =
{
  jobs: :jobs,
  row_count: :row_count
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ JobListData

Returns a new instance of JobListData.



17
18
19
20
21
22
# File 'lib/rafflesia/jobs/job_list_data.rb', line 17

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

Instance Attribute Details

#jobsObject

Returns the value of attribute jobs.



13
14
15
# File 'lib/rafflesia/jobs/job_list_data.rb', line 13

def jobs
  @jobs
end

#row_countObject

Returns the value of attribute row_count.



13
14
15
# File 'lib/rafflesia/jobs/job_list_data.rb', line 13

def row_count
  @row_count
end