Class: BackgroundJobs::Sidekiq::AttributeFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/background_jobs/strategies/sidekiq/job_attributes_adapter.rb

Class Method Summary collapse

Class Method Details

.build(value) ⇒ Object



38
39
40
41
42
43
# File 'lib/background_jobs/strategies/sidekiq/job_attributes_adapter.rb', line 38

def self.build(value)
  return HashAttribute.new(value) if value.kind_of?(Hash)
  return ArrayAttribute.new(value) if value.kind_of?(Array)
  return Attribute.new(value) unless value.kind_of?(String)
  StringAttribute.new(value)
end