Class: ActiveJob::Locking::Options
- Inherits:
-
Object
- Object
- ActiveJob::Locking::Options
- Defined in:
- lib/activejob/locking/options.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#adapter_options ⇒ Object
Returns the value of attribute adapter_options.
-
#enqueue_time ⇒ Object
Returns the value of attribute enqueue_time.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#lock_acquire_time ⇒ Object
Returns the value of attribute lock_acquire_time.
-
#lock_time ⇒ Object
Returns the value of attribute lock_time.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Options
constructor
A new instance of Options.
- #merge(other) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Options
Returns a new instance of Options.
13 14 15 16 17 18 19 20 |
# File 'lib/activejob/locking/options.rb', line 13 def initialize( = {}) @adapter = [:adapter] @hosts = [:hosts] @enqueue_time = [:enqueue_time] @lock_time = [:lock_time] @lock_acquire_time = [:lock_acquire_time] @adapter_options = [:adapter_options] end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
6 7 8 |
# File 'lib/activejob/locking/options.rb', line 6 def adapter @adapter end |
#adapter_options ⇒ Object
Returns the value of attribute adapter_options.
11 12 13 |
# File 'lib/activejob/locking/options.rb', line 11 def @adapter_options end |
#enqueue_time ⇒ Object
Returns the value of attribute enqueue_time.
10 11 12 |
# File 'lib/activejob/locking/options.rb', line 10 def enqueue_time @enqueue_time end |
#hosts ⇒ Object
Returns the value of attribute hosts.
7 8 9 |
# File 'lib/activejob/locking/options.rb', line 7 def hosts @hosts end |
#lock_acquire_time ⇒ Object
Returns the value of attribute lock_acquire_time.
9 10 11 |
# File 'lib/activejob/locking/options.rb', line 9 def lock_acquire_time @lock_acquire_time end |
#lock_time ⇒ Object
Returns the value of attribute lock_time.
8 9 10 |
# File 'lib/activejob/locking/options.rb', line 8 def lock_time @lock_time end |
Instance Method Details
#merge(other) ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/activejob/locking/options.rb', line 61 def merge(other) result = self.dup result.adapter = other.adapter if other.adapter result.hosts = other.hosts if other.hosts result.enqueue_time = other.enqueue_time if other.enqueue_time result.lock_time = other.lock_time if other.lock_time result.lock_acquire_time = other.lock_acquire_time if other.lock_acquire_time result. = other. if other. result end |