Class: Mint::DocumentTreeNode
- Inherits:
-
Object
- Object
- Mint::DocumentTreeNode
- Defined in:
- lib/mint/document_tree.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pathname ⇒ Object
readonly
Returns the value of attribute pathname.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #directory? ⇒ Boolean
- #file? ⇒ Boolean
-
#initialize(name:, pathname:, title:, depth: 0, is_file: false) ⇒ DocumentTreeNode
constructor
A new instance of DocumentTreeNode.
Constructor Details
#initialize(name:, pathname:, title:, depth: 0, is_file: false) ⇒ DocumentTreeNode
Returns a new instance of DocumentTreeNode.
146 147 148 149 150 151 152 153 |
# File 'lib/mint/document_tree.rb', line 146 def initialize(name:, pathname:, title:, depth: 0, is_file: false) @name = name @pathname = pathname @title = title @depth = depth @is_file = is_file @children = [] end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
144 145 146 |
# File 'lib/mint/document_tree.rb', line 144 def children @children end |
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
144 145 146 |
# File 'lib/mint/document_tree.rb', line 144 def depth @depth end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
144 145 146 |
# File 'lib/mint/document_tree.rb', line 144 def name @name end |
#pathname ⇒ Object (readonly)
Returns the value of attribute pathname.
144 145 146 |
# File 'lib/mint/document_tree.rb', line 144 def pathname @pathname end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
144 145 146 |
# File 'lib/mint/document_tree.rb', line 144 def title @title end |
Instance Method Details
#directory? ⇒ Boolean
159 160 161 |
# File 'lib/mint/document_tree.rb', line 159 def directory? !@is_file end |
#file? ⇒ Boolean
155 156 157 |
# File 'lib/mint/document_tree.rb', line 155 def file? @is_file end |