Text File Writer Assignment

From CSE425S Wiki
Revision as of 17:35, 25 April 2022 by Dennis.cosgrove (talk | contribs) (Created page with "=Code To Implement= ==open_yield_close== {{RubyToImplement|text_file_writer|text_file_writer|TextFileWriter|Object|open_yield_close(path)}} =Client= <nowiki> TextFileWriter...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code To Implement

open_yield_close

file: src/main/ruby/text_file_writer/text_file_writer.rb Ruby logo.svg
class: TextFileWriter
superclass: Object
methods: open_yield_close(path)

Client

  TextFileWriter.open_yield_close(path) do |file|
    file.write("<html><body><h1>#{Time.now}</h1></body></html>")
  end