Class: BackgroundJobs::Sidekiq::HashAttribute
- Inherits:
-
Hash
- Object
- Hash
- BackgroundJobs::Sidekiq::HashAttribute
- Defined in:
- lib/background_jobs/strategies/sidekiq/job_attributes_adapter.rb
Instance Method Summary collapse
- #decode ⇒ Object
- #encode ⇒ Object
-
#initialize(value) ⇒ HashAttribute
constructor
A new instance of HashAttribute.
Constructor Details
#initialize(value) ⇒ HashAttribute
Returns a new instance of HashAttribute.
76 77 78 |
# File 'lib/background_jobs/strategies/sidekiq/job_attributes_adapter.rb', line 76 def initialize(value) @value = value end |
Instance Method Details
#decode ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/background_jobs/strategies/sidekiq/job_attributes_adapter.rb', line 89 def decode @value.keys.each do |key| @value[key.to_sym] = AttributeFactory.build(@value.delete(key)).decode end @value end |
#encode ⇒ Object
80 81 82 83 84 85 86 87 |
# File 'lib/background_jobs/strategies/sidekiq/job_attributes_adapter.rb', line 80 def encode @value.keys.each do |key| value = @value.delete(key) @value[key.to_s] = AttributeFactory.build(value).encode end @value end |