Class: Sms::Method::File

Inherits:
Object
  • Object
show all
Defined in:
lib/sms/method/file.rb

Instance Method Summary collapse

Constructor Details

#initializeFile

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