Class: Qless::BaseJob
- Inherits:
-
Object
- Object
- Qless::BaseJob
- Defined in:
- lib/qless/job.rb
Overview
The base for both Job and RecurringJob
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(client, jid) ⇒ BaseJob
constructor
A new instance of BaseJob.
- #klass ⇒ Object
- #queue ⇒ Object
Constructor Details
#initialize(client, jid) ⇒ BaseJob
Returns a new instance of BaseJob.
14 15 16 17 |
# File 'lib/qless/job.rb', line 14 def initialize(client, jid) @client = client @jid = jid end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
12 13 14 |
# File 'lib/qless/job.rb', line 12 def client @client end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
29 30 31 32 33 |
# File 'lib/qless/job.rb', line 29 def ==(other) self.class == other.class && jid == other.jid && client == other.client end |
#hash ⇒ Object
36 37 38 |
# File 'lib/qless/job.rb', line 36 def hash self.class.hash ^ jid.hash ^ client.hash end |
#klass ⇒ Object
19 20 21 22 23 |
# File 'lib/qless/job.rb', line 19 def klass @klass ||= @klass_name.split('::').reduce(Object) do |context, name| context.const_get(name) end end |