Class: Sidekiq::Superworker::DSLHash

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/superworker/dsl_hash.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject

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_recordsObject



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