Class: Deris::Directory
- Inherits:
-
Object
- Object
- Deris::Directory
- Includes:
- DirectoryWriter, PartialHasher, SubdirectoryList
- Defined in:
- lib/directory.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#partials ⇒ Object
readonly
Returns the value of attribute partials.
Instance Method Summary collapse
-
#initialize(directory, defaults = {}, depth = 0) ⇒ Directory
constructor
A new instance of Directory.
- #sub_output(output) ⇒ Object
Methods included from SubdirectoryList
Methods included from DirectoryWriter
Methods included from PartialHasher
Constructor Details
#initialize(directory, defaults = {}, depth = 0) ⇒ Directory
Returns a new instance of Directory.
10 11 12 13 14 15 |
# File 'lib/directory.rb', line 10 def initialize(directory, defaults = {}, depth = 0) @directory = directory @file_name = ::File.basename(directory) @partials = defaults.merge(partials_hash) @depth = depth end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
8 9 10 |
# File 'lib/directory.rb', line 8 def directory @directory end |
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
8 9 10 |
# File 'lib/directory.rb', line 8 def file_name @file_name end |
#partials ⇒ Object (readonly)
Returns the value of attribute partials.
8 9 10 |
# File 'lib/directory.rb', line 8 def partials @partials end |
Instance Method Details
#sub_output(output) ⇒ Object
17 18 19 |
# File 'lib/directory.rb', line 17 def sub_output(output) return ::File.join(output, @file_name), @depth + 1 end |