Class: AWS::S3::Tree::BranchNode
- Inherits:
-
Node
- Object
- Node
- AWS::S3::Tree::BranchNode
- Includes:
- Parent
- Defined in:
- lib/aws/s3/tree/branch_node.rb
Overview
Note:
Generally you do not need to create branch nodes.
Represents a branch in an AWS::S3::Tree. From a branch node you can descend deeper into the tree using Parent#children or go back to the parent node using #parent.
When enumerating nodes in an S3 tree keys grouped by a common prefix are represented as a branch node.
Branch nodes are often treated like directories.
Instance Attribute Summary collapse
-
#parent ⇒ Tree, BranchNode
readonly
The parent node in the tree.
Attributes included from Parent
#collection, #delimiter, #prefix
Instance Method Summary collapse
-
#as_tree ⇒ Tree
Returns a new Tree object that starts at this branch node.
- #branch? ⇒ true
- #leaf? ⇒ false
Methods included from Parent
Instance Attribute Details
#parent ⇒ Tree, BranchNode (readonly)
Returns The parent node in the tree.
41 42 43 |
# File 'lib/aws/s3/tree/branch_node.rb', line 41 def parent @parent end |
Instance Method Details
#as_tree ⇒ Tree
Returns a new Tree object that starts at this branch node. The returned tree will have the same prefix, delimiter and append mode as the tree the branch belongs to.
58 59 60 61 62 63 |
# File 'lib/aws/s3/tree/branch_node.rb', line 58 def as_tree Tree.new(collection, :prefix => prefix, :delimiter => delimiter, :append => append?) end |
#branch? ⇒ true
44 45 46 |
# File 'lib/aws/s3/tree/branch_node.rb', line 44 def branch? true end |
#leaf? ⇒ false
49 50 51 |
# File 'lib/aws/s3/tree/branch_node.rb', line 49 def leaf? false end |