class CFA::MemoryFile

memory file is used when string is stored only in memory. Useful for testing. For remote read or socket read, own File class creation is recommended.

Attributes

content[RW]

Public Class Methods

new(content = "") click to toggle source
# File lib/cfa/memory_file.rb, line 10
def initialize(content = "")
  @content = content
end

Public Instance Methods

read(_path) click to toggle source
# File lib/cfa/memory_file.rb, line 14
def read(_path)
  @content.dup
end
write(_path, content) click to toggle source
# File lib/cfa/memory_file.rb, line 18
def write(_path, content)
  @content = content
end