Class: ResquePoll::Job
- Inherits:
-
Object
- Object
- ResquePoll::Job
- Extended by:
- ActiveModel::Naming
- Defined in:
- app/models/resque_poll/job.rb
Instance Attribute Summary collapse
-
#job_id ⇒ Object
readonly
Returns the value of attribute job_id.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
- #create ⇒ Object
-
#initialize(klass, params) ⇒ Job
constructor
A new instance of Job.
Constructor Details
#initialize(klass, params) ⇒ Job
Returns a new instance of Job.
6 7 8 9 |
# File 'app/models/resque_poll/job.rb', line 6 def initialize(klass, params) @klass = klass @params = params end |
Instance Attribute Details
#job_id ⇒ Object (readonly)
Returns the value of attribute job_id.
4 5 6 |
# File 'app/models/resque_poll/job.rb', line 4 def job_id @job_id end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
4 5 6 |
# File 'app/models/resque_poll/job.rb', line 4 def klass @klass end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'app/models/resque_poll/job.rb', line 4 def params @params end |
Class Method Details
.create(*args) ⇒ Object
11 12 13 |
# File 'app/models/resque_poll/job.rb', line 11 def self.create(*args) new(*args).create end |
Instance Method Details
#as_json(options = {}) ⇒ Object
20 21 22 |
# File 'app/models/resque_poll/job.rb', line 20 def as_json( = {}) {poll: job_path} end |
#create ⇒ Object
15 16 17 18 |
# File 'app/models/resque_poll/job.rb', line 15 def create @job_id = klass.create(params) self end |