Class: SidekiqUniqueJobs::Lock::LockInfoStub

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_unique_jobs/lock.rb

Overview

Minimal struct to provide .value and hash-like access for web UI compat

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ LockInfoStub

Returns a new instance of LockInfoStub.



171
172
173
# File 'lib/sidekiq_unique_jobs/lock.rb', line 171

def initialize(hash = {})
  @hash = hash
end

Instance Method Details

#[](key) ⇒ Object



179
180
181
# File 'lib/sidekiq_unique_jobs/lock.rb', line 179

def [](key)
  @hash[key]
end

#any?Boolean

Returns:

  • (Boolean)


187
188
189
# File 'lib/sidekiq_unique_jobs/lock.rb', line 187

def any?
  !none?
end

#none?Boolean

Returns:

  • (Boolean)


183
184
185
# File 'lib/sidekiq_unique_jobs/lock.rb', line 183

def none?
  @hash.empty?
end

#valueObject



175
176
177
# File 'lib/sidekiq_unique_jobs/lock.rb', line 175

def value
  @hash
end