Class: FakeFS::FakeSymlink
- Inherits:
-
Object
- Object
- FakeFS::FakeSymlink
show all
- Defined in:
- lib/fakefs/fake/symlink.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of FakeSymlink.
6
7
8
|
# File 'lib/fakefs/fake/symlink.rb', line 6
def initialize(target)
@target = target
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
28
29
30
|
# File 'lib/fakefs/fake/symlink.rb', line 28
def method_missing(*args, &block)
entry.send(*args, &block)
end
|
Instance Attribute Details
#name ⇒ Object
Also known as:
to_s
Returns the value of attribute name.
3
4
5
|
# File 'lib/fakefs/fake/symlink.rb', line 3
def name
@name
end
|
#target ⇒ Object
Returns the value of attribute target.
3
4
5
|
# File 'lib/fakefs/fake/symlink.rb', line 3
def target
@target
end
|
Instance Method Details
#delete ⇒ Object
18
19
20
|
# File 'lib/fakefs/fake/symlink.rb', line 18
def delete
parent.delete(self)
end
|
#entry ⇒ Object
14
15
16
|
# File 'lib/fakefs/fake/symlink.rb', line 14
def entry
FileSystem.find(target)
end
|
#inspect ⇒ Object
10
11
12
|
# File 'lib/fakefs/fake/symlink.rb', line 10
def inspect
"symlink(#{target.split('/').last})"
end
|
#respond_to?(method) ⇒ Boolean
22
23
24
|
# File 'lib/fakefs/fake/symlink.rb', line 22
def respond_to?(method)
entry.respond_to?(method)
end
|