Sha256: 433682bfc1fa2d3e50813224f0460e42f19a551ebda71aa494c7c005fbd1ece5

Contents?: true

Size: 476 Bytes

Versions: 9

Compression:

Stored size: 476 Bytes

Contents

module Faker
  class File < Base
    class << self

      def extension
        fetch('file.extension')
      end

      def mime_type
        fetch('file.mime_type')
      end

      def file_name(dir = nil, name = nil, ext = nil, directory_separator = '/')

        dir = Faker::Internet::slug unless dir
        name = Faker::Lorem::word.downcase unless name
        ext ||= extension

        [dir, name].join(directory_separator) + ".#{ext}"
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
faker-1.8.7 lib/faker/file.rb
faker-1.8.6 lib/faker/file.rb
faker-1.8.5 lib/faker/file.rb
faker-1.8.4 lib/faker/file.rb
faker-1.8.3 lib/faker/file.rb
faker-1.8.2 lib/faker/file.rb
faker-1.8.0 lib/faker/file.rb
faker-1.7.3 lib/faker/file.rb
faker-1.7.2 lib/faker/file.rb