Module: FFaker::Filesystem

Extended by:
Filesystem, ModuleUtils
Included in:
Filesystem
Defined in:
lib/ffaker/filesystem.rb

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#directory(directory_separator = File::SEPARATOR) ⇒ Object


16
17
18
# File 'lib/ffaker/filesystem.rb', line 16

def directory(directory_separator = File::SEPARATOR)
  Lorem.words.join(directory_separator)
end

#extensionObject


8
9
10
# File 'lib/ffaker/filesystem.rb', line 8

def extension
  fetch_sample(EXTENSION)
end

#file_name(dir = directory, name = Lorem.word.downcase, ext = extension, directory_separator = File::SEPARATOR) ⇒ Object


20
21
22
23
# File 'lib/ffaker/filesystem.rb', line 20

def file_name(dir = directory, name = Lorem.word.downcase,
              ext = extension, directory_separator = File::SEPARATOR)
  "#{dir}#{directory_separator}#{name}.#{ext}"
end

#mime_typeObject


12
13
14
# File 'lib/ffaker/filesystem.rb', line 12

def mime_type
  fetch_sample(MIME_TYPE)
end