class Distillery::ROM::Path::Virtual

Path without physical implementation. Used for ROM defined in DAT file

Public Class Methods

new(entry) click to toggle source

@param entry [String]

# File lib/distillery/rom/path/virtual.rb, line 11
def initialize(entry)
    if ! entry.kind_of?(String)
        raise ArgumentError
    end
    @entry = entry
end

Public Instance Methods

basename() click to toggle source

(see ROM::Path#basename)

# File lib/distillery/rom/path/virtual.rb, line 39
def basename
    ::File.basename(@entry)
end
copy(to, length = nil, offset = 0, force: false, link: :hard) click to toggle source

(see ROM::Path#copy)

# File lib/distillery/rom/path/virtual.rb, line 49
def copy(to, length = nil, offset = 0, force: false, link: :hard)
    false
end
delete!() click to toggle source

(see ROM::Path#delete!)

# File lib/distillery/rom/path/virtual.rb, line 63
def delete!
    true
end
entry() click to toggle source

(see ROM::Path#entry)

# File lib/distillery/rom/path/virtual.rb, line 34
def entry
    @entry
end
file() click to toggle source

(see ROM::Path#file)

# File lib/distillery/rom/path/virtual.rb, line 24
def file
    nil
end
reader(&block) click to toggle source

(see ROM::Path#reader)

# File lib/distillery/rom/path/virtual.rb, line 44
def reader(&block)
    nil
end
rename(path, force: false) click to toggle source

(see ROM::Path#rename)

# File lib/distillery/rom/path/virtual.rb, line 54
def rename(path, force: false)
    case path
    when String then @entry = path
    else raise ArgumentError, "unsupport path type (#{path.class})"
    end
    true
end
storage() click to toggle source

(see ROM::Path#storage)

# File lib/distillery/rom/path/virtual.rb, line 29
def storage
    nil
end
to_s() click to toggle source

(see ROM::Path#to_s)

# File lib/distillery/rom/path/virtual.rb, line 19
def to_s
    @entry
end