Class: FileTreeProfiler::Profile
- Inherits:
-
Object
- Object
- FileTreeProfiler::Profile
- Defined in:
- lib/file_tree_profiler/profile.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #checksum ⇒ Object
-
#initialize(full_path) ⇒ Profile
constructor
A new instance of Profile.
- #size ⇒ Object
Constructor Details
#initialize(full_path) ⇒ Profile
Returns a new instance of Profile.
6 7 8 9 10 11 12 |
# File 'lib/file_tree_profiler/profile.rb', line 6 def initialize full_path raise ArgumentError, "Not a directory - #{full_path}" \ unless ::File.directory?(full_path) dir_name = ::File.basename(full_path) @path = full_path.gsub(::File.join('', dir_name), '') @root = DirFile.new(self, dir_name) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/file_tree_profiler/profile.rb', line 3 def path @path end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
3 4 5 |
# File 'lib/file_tree_profiler/profile.rb', line 3 def root @root end |