Class: FileSystem::FakeFile
- Inherits:
-
Object
- Object
- FileSystem::FakeFile
- Defined in:
- lib/file_system/file/fake_file.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(traverser, name) ⇒ FakeFile
constructor
A new instance of FakeFile.
- #is_dir? ⇒ Boolean
- #is_file? ⇒ Boolean
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
#name ⇒ Object
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
#create ⇒ Object
9 10 11 |
# File 'lib/file_system/file/fake_file.rb', line 9 def create puts "FILE: #{name}" end |
#is_dir? ⇒ Boolean
17 18 19 |
# File 'lib/file_system/file/fake_file.rb', line 17 def is_dir? false end |
#is_file? ⇒ Boolean
13 14 15 |
# File 'lib/file_system/file/fake_file.rb', line 13 def is_file? true end |