Class: ActionShortMessage::MessageDelivery
- Inherits:
-
Object
- Object
- ActionShortMessage::MessageDelivery
- Defined in:
- lib/action_short_message/message_delivery.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#messenger_class ⇒ Object
readonly
Returns the value of attribute messenger_class.
Instance Method Summary collapse
- #deliver_later(options = {}) ⇒ Object
- #deliver_now ⇒ Object
-
#initialize(messenger_class, action, *args) ⇒ MessageDelivery
constructor
A new instance of MessageDelivery.
- #messenger_instance ⇒ Object
Constructor Details
#initialize(messenger_class, action, *args) ⇒ MessageDelivery
Returns a new instance of MessageDelivery.
5 6 7 8 9 |
# File 'lib/action_short_message/message_delivery.rb', line 5 def initialize(messenger_class, action, *args) @messenger_class = messenger_class @action = action @args = args end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/action_short_message/message_delivery.rb', line 3 def action @action end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/action_short_message/message_delivery.rb', line 3 def args @args end |
#messenger_class ⇒ Object (readonly)
Returns the value of attribute messenger_class.
3 4 5 |
# File 'lib/action_short_message/message_delivery.rb', line 3 def messenger_class @messenger_class end |
Instance Method Details
#deliver_later(options = {}) ⇒ Object
19 20 21 |
# File 'lib/action_short_message/message_delivery.rb', line 19 def deliver_later( = {}) enqueue_delivery :deliver_now, end |
#deliver_now ⇒ Object
15 16 17 |
# File 'lib/action_short_message/message_delivery.rb', line 15 def deliver_now processed_messenger.send(action, *@args).deliver end |
#messenger_instance ⇒ Object
11 12 13 |
# File 'lib/action_short_message/message_delivery.rb', line 11 def messenger_instance processed_messenger.send(action, *@args) end |