Class: TxghQueue::Job
- Inherits:
-
Object
- Object
- TxghQueue::Job
- Includes:
- TxghServer::ResponseHelpers
- Defined in:
- lib/txgh-queue/job.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(logger) ⇒ Job
constructor
A new instance of Job.
- #process(payload) ⇒ Object
Constructor Details
#initialize(logger) ⇒ Job
Returns a new instance of Job.
10 11 12 |
# File 'lib/txgh-queue/job.rb', line 10 def initialize(logger) @logger = logger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'lib/txgh-queue/job.rb', line 8 def logger @logger end |
Instance Method Details
#process(payload) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/txgh-queue/job.rb', line 14 def process(payload) Supervisor.supervise do case payload.fetch('txgh_event') when 'github.push', 'github.delete', 'gitlab.push', 'gitlab.delete', 'transifex.hook' handle_expected(payload) else handle_unexpected end end end |