Class: ActionMessage::Message
- Inherits:
-
Object
- Object
- ActionMessage::Message
- Defined in:
- lib/action_message/message.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#args ⇒ Object
Returns the value of attribute args.
-
#body ⇒ Object
Returns the value of attribute body.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
- #debug? ⇒ Boolean
- #deliver ⇒ Object
-
#initialize ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize ⇒ Message
Returns a new instance of Message.
8 9 10 |
# File 'lib/action_message/message.rb', line 8 def initialize @adapter = Adapters.adapter end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
5 6 7 |
# File 'lib/action_message/message.rb', line 5 def action @action end |
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
6 7 8 |
# File 'lib/action_message/message.rb', line 6 def adapter @adapter end |
#args ⇒ Object
Returns the value of attribute args.
5 6 7 |
# File 'lib/action_message/message.rb', line 5 def args @args end |
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/action_message/message.rb', line 5 def body @body end |
#debug ⇒ Object
Returns the value of attribute debug.
5 6 7 |
# File 'lib/action_message/message.rb', line 5 def debug @debug end |
#to ⇒ Object
Returns the value of attribute to.
5 6 7 |
# File 'lib/action_message/message.rb', line 5 def to @to end |
Instance Method Details
#debug? ⇒ Boolean
12 13 14 |
# File 'lib/action_message/message.rb', line 12 def debug? !!@debug end |
#deliver ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/action_message/message.rb', line 16 def deliver if debug? # TODO: add log return nil elsif Interceptor.registered_for?(self) # TODO: add log return nil else # TODO: add logger 'Sending message from "number" to "number"' adapter.(body, to: to) end end |