Class: Xsys::Model::BackgroundJob
- Inherits:
-
Object
- Object
- Xsys::Model::BackgroundJob
- Defined in:
- lib/xsys/model/background_job.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BackgroundJob
constructor
A new instance of BackgroundJob.
Constructor Details
#initialize(attributes = {}) ⇒ BackgroundJob
Returns a new instance of BackgroundJob.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/xsys/model/background_job.rb', line 11 def initialize(attributes={}) attributes.each do |k, v| if k.to_s == 'events' @events = v.map { |x| JobEvent.new(x) } elsif k.to_s == 'started_at' @started_at = Time.parse(v) elsif k.to_s == 'ended_at' @ended_at = Time.parse(v) unless v.nil? else self.send("#{k}=", v) if self.respond_to?(k) end end end |
Class Method Details
.attr_list ⇒ Object
4 5 6 7 |
# File 'lib/xsys/model/background_job.rb', line 4 def self.attr_list [:code, :shop_code, :label, :arguments, :status, :processed_items, :total_items, :observations, :started_at, :ended_at, :events] end |