Class: ActionMessageTexter::MessageDelivery
- Inherits:
-
Delegator
- Object
- Delegator
- ActionMessageTexter::MessageDelivery
- Defined in:
- lib/action_message_texter/message_delivery.rb
Overview
分派工作
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #__setobj__(message) ⇒ Object
- #deliver_later(options = {}) ⇒ Object
- #deliver_now ⇒ Object
-
#initialize(texter_class, action, *args) ⇒ MessageDelivery
constructor
A new instance of MessageDelivery.
- #message ⇒ Object
-
#processed? ⇒ Boolean
是否送出.
Constructor Details
#initialize(texter_class, action, *args) ⇒ MessageDelivery
Returns a new instance of MessageDelivery.
6 7 8 9 10 |
# File 'lib/action_message_texter/message_delivery.rb', line 6 def initialize(texter_class, action, *args) @texter_class = texter_class @action = action @args = args end |
Instance Method Details
#__getobj__ ⇒ Object
22 23 24 |
# File 'lib/action_message_texter/message_delivery.rb', line 22 def __getobj__ @message ||= processed_messenger. end |
#__setobj__(message) ⇒ Object
26 27 28 |
# File 'lib/action_message_texter/message_delivery.rb', line 26 def __setobj__() @message = end |
#deliver_later(options = {}) ⇒ Object
18 19 20 |
# File 'lib/action_message_texter/message_delivery.rb', line 18 def deliver_later( = {}) enqueue_delivery :deliver_now, end |
#deliver_now ⇒ Object
12 13 14 15 16 |
# File 'lib/action_message_texter/message_delivery.rb', line 12 def deliver_now processed_messenger.handle_exceptions do .deliver end end |
#message ⇒ Object
30 31 32 |
# File 'lib/action_message_texter/message_delivery.rb', line 30 def __getobj__ end |
#processed? ⇒ Boolean
是否送出
35 36 37 |
# File 'lib/action_message_texter/message_delivery.rb', line 35 def processed? @processed_messenger || @message end |