Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/vfs/integration/string.rb

Direct Known Subclasses

Vfs::Path

Instance Method Summary collapse

Instance Method Details

#to_dir_on(storage = nil) ⇒ Object Also known as: to_dir



16
17
18
# File 'lib/vfs/integration/string.rb', line 16

def to_dir_on storage = nil
  to_entry_on(storage).dir
end

#to_entry_on(storage = nil) ⇒ Object Also known as: to_entry



2
3
4
5
6
7
8
# File 'lib/vfs/integration/string.rb', line 2

def to_entry_on storage = nil
  path = self
  storage ||= Vfs.default_storage

  path = "./#{path}" unless path =~ /^[\/\.\~]/
  Vfs::Dir.new(storage, path)
end

#to_file_on(storage = nil) ⇒ Object Also known as: to_file



11
12
13
# File 'lib/vfs/integration/string.rb', line 11

def to_file_on storage = nil
  to_entry_on(storage).file
end