Class: SmsGateway::Sms
- Inherits:
-
Struct
- Object
- Struct
- SmsGateway::Sms
- Defined in:
- lib/sms_gateway/sms.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#route ⇒ Object
Returns the value of attribute route.
-
#text ⇒ Object
Returns the value of attribute text.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
- #deliver ⇒ Object
-
#initialize(params) ⇒ Sms
constructor
A new instance of Sms.
- #to_s ⇒ Object
Constructor Details
#initialize(params) ⇒ Sms
Returns a new instance of Sms.
5 6 7 8 9 10 |
# File 'lib/sms_gateway/sms.rb', line 5 def initialize(params) self.from = params[:from]||SmsGateway::Base.from self.to = params[:to] self.text = params[:text] self.route = params[:route] end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from
3 4 5 |
# File 'lib/sms_gateway/sms.rb', line 3 def from @from end |
#route ⇒ Object
Returns the value of attribute route
3 4 5 |
# File 'lib/sms_gateway/sms.rb', line 3 def route @route end |
#text ⇒ Object
Returns the value of attribute text
3 4 5 |
# File 'lib/sms_gateway/sms.rb', line 3 def text @text end |
#to ⇒ Object
Returns the value of attribute to
3 4 5 |
# File 'lib/sms_gateway/sms.rb', line 3 def to @to end |
Instance Method Details
#deliver ⇒ Object
12 13 14 |
# File 'lib/sms_gateway/sms.rb', line 12 def deliver SmsGateway::Base.deliver(self) end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/sms_gateway/sms.rb', line 16 def to_s "SMS: from:#{self.from}, to:#{self.to}, text:#{self.text}" end |