Skip to content

Instantly share code, notes, and snippets.

@kmandreza
Last active December 12, 2015 08:19
Show Gist options
  • Save kmandreza/4743412 to your computer and use it in GitHub Desktop.
Save kmandreza/4743412 to your computer and use it in GitHub Desktop.
To Do
class FileReadWrite
def initialize(filename)
@filename = filename
end
def read_file
File.open(@filename).readlines
end
def write_file(list_items)
File.open(@filename, 'w') do |f|
list_items.each { |list_item| f.write(list_item)}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment