Class: Sms::Method::File
- Inherits:
-
Object
- Object
- Sms::Method::File
- Defined in:
- lib/sms/method/file.rb
Instance Method Summary collapse
- #deliver!(sms) ⇒ Object
-
#initialize ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize ⇒ File
Returns a new instance of File.
5 6 7 8 9 |
# File 'lib/sms/method/file.rb', line 5 def initialize @file = ::File.open('/tmp/sms.csv', 'w') @file.sync = true @file.write("from,to,text\n") end |
Instance Method Details
#deliver!(sms) ⇒ Object
11 12 13 |
# File 'lib/sms/method/file.rb', line 11 def deliver!(sms) @file.write([sms.from, sms.to, sms.text].to_csv) end |