Class: Sidekiq::Superworker::DSLHash
- Inherits:
-
Object
- Object
- Sidekiq::Superworker::DSLHash
- Defined in:
- lib/sidekiq/superworker/dsl_hash.rb
Instance Attribute Summary collapse
-
#record_id ⇒ Object
Returns the value of attribute record_id.
Instance Method Summary collapse
-
#initialize(hash, args = {}) ⇒ DSLHash
constructor
A new instance of DSLHash.
- #rewrite_record_ids(first_record_id) ⇒ Object
- #to_records ⇒ Object
Constructor Details
#initialize(hash, args = {}) ⇒ DSLHash
Returns a new instance of DSLHash.
6 7 8 9 |
# File 'lib/sidekiq/superworker/dsl_hash.rb', line 6 def initialize(hash, args={}) @hash = hash @args = args end |
Instance Attribute Details
#record_id ⇒ Object
Returns the value of attribute record_id.
4 5 6 |
# File 'lib/sidekiq/superworker/dsl_hash.rb', line 4 def record_id @record_id end |
Instance Method Details
#rewrite_record_ids(first_record_id) ⇒ Object
11 12 13 14 |
# File 'lib/sidekiq/superworker/dsl_hash.rb', line 11 def rewrite_record_ids(first_record_id) @record_id = first_record_id - 1 rewrite_ids_of_nested_hash(@hash) end |
#to_records ⇒ Object
16 17 18 19 20 |
# File 'lib/sidekiq/superworker/dsl_hash.rb', line 16 def to_records @record_id = 1 @records = {} nested_hash_to_records(@hash) end |