Sha256: 84a86b757d19e38652d0acfea538b0efd474e51b914e2ced45fbf941af23141f
Contents?: true
Size: 867 Bytes
Versions: 7
Compression:
Stored size: 867 Bytes
Contents
module Gemirro ## # Similar to {Gemirro::MirrorDirectory} the MirrorFile class is used to # make it easier to read and write data in a directory that mirrors data from # an external source. # # @!attribute [r] path # @return [String] # class MirrorFile attr_reader :path ## # @param [String] path # def initialize(path) @path = path end ## # Writes the specified content to the current file. Existing files are # overwritten. # # @param [String] content # def write(content) handle = File.open(@path, 'w') handle.write(content) handle.close end ## # Reads the content of the current file. # # @return [String] # def read handle = File.open(@path, 'r') content = handle.read handle.close content end end end
Version data entries
7 entries across 7 versions & 1 rubygems