Class: Agilibox::SMS::Message

Inherits:
Object
  • Object
show all
Defined in:
app/sms/agilibox/sms/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (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_laterObject

TODO : Delay



22
23
24
# File 'app/sms/agilibox/sms/message.rb', line 22

def deliver_later
  deliver_now
end

#deliver_nowObject



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