class InVFS::StringMapFS

Attributes

map[R]

Public Class Methods

new(*map) click to toggle source
# File lib/invfs/stringmapfs.rb, line 9
def initialize(*map)
  @map = Hash[*map]
end

Public Instance Methods

file?(path) click to toggle source
# File lib/invfs/stringmapfs.rb, line 17
def file?(path)
  !!map.has_key?(path)
end
read(path) click to toggle source
# File lib/invfs/stringmapfs.rb, line 25
def read(path)
  (map[path] or return nil).to_s
end
size(path) click to toggle source
# File lib/invfs/stringmapfs.rb, line 21
def size(path)
  (map[path] or return nil).bytesize
end
to_path() click to toggle source
# File lib/invfs/stringmapfs.rb, line 13
def to_path
  sprintf %(#<%s 0x%08x>) % [self.class, object_id]
end