Class: ActionMessageTexter::Message
- Inherits:
-
Object
- Object
- ActionMessageTexter::Message
- Defined in:
- lib/action_message_texter/message.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#deliver_at ⇒ Object
Returns the value of attribute deliver_at.
-
#delivery_handler ⇒ Object
Returns the value of attribute delivery_handler.
- #delivery_method(method = nil, _settings = {}) ⇒ Object
-
#delivery_options ⇒ Object
Returns the value of attribute delivery_options.
-
#other_options ⇒ Object
Returns the value of attribute other_options.
-
#raise_delivery_errors ⇒ Object
Returns the value of attribute raise_delivery_errors.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize ⇒ Message
constructor
TODO: create registred interceptor and observer.
Constructor Details
#initialize ⇒ Message
TODO: create registred interceptor and observer
10 11 12 |
# File 'lib/action_message_texter/message.rb', line 10 def initialize @raise_delivery_errors = true end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/action_message_texter/message.rb', line 3 def content @content end |
#deliver_at ⇒ Object
Returns the value of attribute deliver_at.
3 4 5 |
# File 'lib/action_message_texter/message.rb', line 3 def deliver_at @deliver_at end |
#delivery_handler ⇒ Object
Returns the value of attribute delivery_handler.
3 4 5 |
# File 'lib/action_message_texter/message.rb', line 3 def delivery_handler @delivery_handler end |
#delivery_method(method = nil, _settings = {}) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/action_message_texter/message.rb', line 25 def delivery_method(method = nil, _settings = {}) if method # TODO: get provider from configuration @delivery_method = SMSProvider::Base.new else @delivery_method end end |
#delivery_options ⇒ Object
Returns the value of attribute delivery_options.
3 4 5 |
# File 'lib/action_message_texter/message.rb', line 3 def end |
#other_options ⇒ Object
Returns the value of attribute other_options.
3 4 5 |
# File 'lib/action_message_texter/message.rb', line 3 def end |
#raise_delivery_errors ⇒ Object
Returns the value of attribute raise_delivery_errors.
3 4 5 |
# File 'lib/action_message_texter/message.rb', line 3 def raise_delivery_errors @raise_delivery_errors end |
#to ⇒ Object
Returns the value of attribute to.
3 4 5 |
# File 'lib/action_message_texter/message.rb', line 3 def to @to end |
Instance Method Details
#deliver ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/action_message_texter/message.rb', line 14 def deliver # inform_interceptors if delivery_handler delivery_handler.(self) { do_delivery } else do_delivery end # inform_observers self end |