Class: FileSystem::FakeFile

Inherits:
Object
  • Object
show all
Defined in:
lib/file_system/file/fake_file.rb

Direct Known Subclasses

FileCreator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(traverser, name) ⇒ FakeFile

Returns a new instance of FakeFile.



5
6
7
# File 'lib/file_system/file/fake_file.rb', line 5

def initialize(traverser, name)
  @name = File.join(traverser.current_dir, name)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/file_system/file/fake_file.rb', line 3

def name
  @name
end

Instance Method Details

#createObject



9
10
11
# File 'lib/file_system/file/fake_file.rb', line 9

def create
  puts "FILE: #{name}"
end

#is_dir?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/file_system/file/fake_file.rb', line 17

def is_dir?
  false
end

#is_file?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/file_system/file/fake_file.rb', line 13

def is_file?
  true
end