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.
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#time ⇒ Object
(also: #lock_time)
Returns the value of attribute time.
-
#timeout ⇒ Object
(also: #lock_acquire_timeout)
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Options
constructor
A new instance of Options.
-
#lock_acquire_timeout= ⇒ Object
Sets the attribute timeout.
- #merge(other) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Options
Returns a new instance of Options.
17 18 19 20 21 22 23 |
# File 'lib/activejob/locking/options.rb', line 17 def initialize( = {}) @adapter = [:adapter] @hosts = [:hosts] @time = [:time] @timeout = [:timeout] = [: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.
10 11 12 |
# File 'lib/activejob/locking/options.rb', line 10 def end |
#hosts ⇒ Object
Returns the value of attribute hosts.
7 8 9 |
# File 'lib/activejob/locking/options.rb', line 7 def hosts @hosts end |
#time ⇒ Object Also known as: lock_time
Returns the value of attribute time.
8 9 10 |
# File 'lib/activejob/locking/options.rb', line 8 def time @time end |
#timeout ⇒ Object Also known as: lock_acquire_timeout
Returns the value of attribute timeout.
9 10 11 |
# File 'lib/activejob/locking/options.rb', line 9 def timeout @timeout end |
Instance Method Details
#lock_acquire_timeout= ⇒ Object
Sets the attribute timeout
15 16 17 |
# File 'lib/activejob/locking/options.rb', line 15 def timeout=(value) @timeout = value end |
#merge(other) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/activejob/locking/options.rb', line 35 def merge(other) result = self.dup result.adapter = other.adapter if other.adapter result.hosts = other.hosts if other.hosts result.time = other.time if other.time result.timeout = other.timeout if other.timeout result. = other. if other. result end |