Class: Agilibox::SMS::Message
- Inherits:
-
Object
- Object
- Agilibox::SMS::Message
- Defined in:
- app/sms/agilibox/sms/message.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#deliver_later ⇒ Object
TODO : Delay.
- #deliver_now ⇒ Object
-
#initialize(data) ⇒ Message
constructor
A new instance of Message.
- #strategy(value = :no_argument) ⇒ Object
- #strategy=(value) ⇒ Object
Constructor Details
#initialize(data) ⇒ Message
Returns a new instance of Message.
4 5 6 |
# File 'app/sms/agilibox/sms/message.rb', line 4 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
2 3 4 |
# File 'app/sms/agilibox/sms/message.rb', line 2 def data @data end |
Instance Method Details
#deliver_later ⇒ Object
TODO : Delay
22 23 24 |
# File 'app/sms/agilibox/sms/message.rb', line 22 def deliver_later deliver_now end |
#deliver_now ⇒ Object
17 18 19 |
# File 'app/sms/agilibox/sms/message.rb', line 17 def deliver_now strategy.call(data) end |
#strategy(value = :no_argument) ⇒ Object
12 13 14 15 |
# File 'app/sms/agilibox/sms/message.rb', line 12 def strategy(value = :no_argument) self.strategy = value unless value == :no_argument @strategy || Agilibox::SMS.strategy end |
#strategy=(value) ⇒ Object
8 9 10 |
# File 'app/sms/agilibox/sms/message.rb', line 8 def strategy=(value) @strategy = Agilibox::SMS.parse_strategy(value) end |