Class: Ferver::FoundFile
- Inherits:
-
Object
- Object
- Ferver::FoundFile
- Defined in:
- lib/ferver/found_file.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
(also: #name)
readonly
Returns the value of attribute file_name.
-
#path_to_file ⇒ Object
readonly
Returns the value of attribute path_to_file.
Instance Method Summary collapse
-
#initialize(directory, file_name) ⇒ FoundFile
constructor
A new instance of FoundFile.
- #valid? ⇒ Boolean
Constructor Details
#initialize(directory, file_name) ⇒ FoundFile
Returns a new instance of FoundFile.
8 9 10 11 |
# File 'lib/ferver/found_file.rb', line 8 def initialize(directory, file_name) @file_name = file_name @path_to_file = File.join(directory, file_name) end |
Instance Attribute Details
#file_name ⇒ Object (readonly) Also known as: name
Returns the value of attribute file_name.
4 5 6 |
# File 'lib/ferver/found_file.rb', line 4 def file_name @file_name end |
#path_to_file ⇒ Object (readonly)
Returns the value of attribute path_to_file.
4 5 6 |
# File 'lib/ferver/found_file.rb', line 4 def path_to_file @path_to_file end |
Instance Method Details
#valid? ⇒ Boolean
13 14 15 |
# File 'lib/ferver/found_file.rb', line 13 def valid? File.file?(path_to_file) && !File.zero?(path_to_file) end |