Sha256: 362d131d4f761535874505dab2995f2c6d7559e074090c658e05610f875509c2
Contents?: true
Size: 891 Bytes
Versions: 26
Compression:
Stored size: 891 Bytes
Contents
# -*- coding: utf-8 -*- 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
26 entries across 26 versions & 1 rubygems