Class: Sidekiq::Throttled::Message
- Inherits:
-
Object
- Object
- Sidekiq::Throttled::Message
- Defined in:
- lib/sidekiq/throttled/message.rb
Instance Method Summary collapse
-
#initialize(item) ⇒ Message
constructor
A new instance of Message.
- #job_args ⇒ Object
- #job_class ⇒ Object
- #job_id ⇒ Object
Constructor Details
#initialize(item) ⇒ Message
Returns a new instance of Message.
6 7 8 |
# File 'lib/sidekiq/throttled/message.rb', line 6 def initialize(item) @item = item.is_a?(Hash) ? item : parse(item) end |
Instance Method Details
#job_args ⇒ Object
14 15 16 |
# File 'lib/sidekiq/throttled/message.rb', line 14 def job_args @item.key?("wrapped") ? @item.dig("args", 0, "arguments") : @item["args"] end |
#job_class ⇒ Object
10 11 12 |
# File 'lib/sidekiq/throttled/message.rb', line 10 def job_class @item.fetch("wrapped") { @item["class"] } end |
#job_id ⇒ Object
18 19 20 |
# File 'lib/sidekiq/throttled/message.rb', line 18 def job_id @item["jid"] end |