Class: FakeFS::FakeSymlink
- Inherits:
-
Object
- Object
- FakeFS::FakeSymlink
- Defined in:
- lib/fakefs/fake/symlink.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
(also: #to_s)
Returns the value of attribute name.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #entry ⇒ Object
-
#initialize(target) ⇒ FakeSymlink
constructor
A new instance of FakeSymlink.
- #inspect ⇒ Object
- #method_missing(*args, &block) ⇒ Object
- #respond_to?(method) ⇒ Boolean
Constructor Details
#initialize(target) ⇒ FakeSymlink
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
18 19 20 |
# File 'lib/fakefs/fake/symlink.rb', line 18 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
#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 |