Sha256: beb181cfb5c00fb5510c6469cd691bca3cf9ecdce1be09dbdd6a1a87622d8f63

Contents?: true

Size: 690 Bytes

Versions: 8

Compression:

Stored size: 690 Bytes

Contents

require 'memfs/fake/entry'
require 'memfs/fake/file/content'

module MemFs
  module Fake
    class File < Entry
      attr_accessor :content

      def close
        @closed = true
      end

      def closed?
        @closed
      end

      def initialize(*args)
        super
        @content = Content.new
        @closed = false
      end

      def pos
        content.pos
      end

      def pos=(value)
        content.pos = value
      end

      def size
        content.size
      end

      def type
        case
        when block_device     then 'blockSpecial'
        when character_device then 'characterSpecial'
        else 'file'
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
memfs-0.5.0 lib/memfs/fake/file.rb
memfs-0.4.3 lib/memfs/fake/file.rb
memfs-0.4.2 lib/memfs/fake/file.rb
memfs-0.4.1 lib/memfs/fake/file.rb
memfs-0.4.0 lib/memfs/fake/file.rb
memfs-0.3.0 lib/memfs/fake/file.rb
memfs-0.2.0 lib/memfs/fake/file.rb
memfs-0.1.0 lib/memfs/fake/file.rb