Class: Folio::Path
- Inherits:
-
Object
- Object
- Folio::Path
- Defined in:
- lib/folio/path.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Path
constructor
A new instance of Path.
- #method_missing(s, *a, &b) ⇒ Object
- #replace(file_object) ⇒ Object
Constructor Details
#initialize(path) ⇒ Path
Returns a new instance of Path.
7 8 9 10 11 12 13 |
# File 'lib/folio/path.rb', line 7 def initialize(path) if File.exist?(path) @delegate = Pathname.new(path, self) else @delegate = FileObject[path] end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(s, *a, &b) ⇒ Object
19 20 21 |
# File 'lib/folio/path.rb', line 19 def method_missing(s, *a, &b) @delegate.__send__(s, *a, &b) end |
Instance Method Details
#replace(file_object) ⇒ Object
15 16 17 |
# File 'lib/folio/path.rb', line 15 def replace(file_object) @delegate = file_object end |