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)
-
- (Tree, BranchNode) parent
readonly
The parent node in the tree.
Attributes included from Parent
#collection, #delimiter, #prefix
Instance Method Summary (collapse)
-
- (Tree) as_tree
Returns a new Tree object that starts at this branch node.
- - (true) branch?
- - (false) leaf?
Methods included from Parent
Instance Attribute Details
- (Tree, BranchNode) parent (readonly)
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
- (Tree) as_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 |
- (true) branch?
44 45 46 |
# File 'lib/aws/s3/tree/branch_node.rb', line 44 def branch? true end |
- (false) leaf?
49 50 51 |
# File 'lib/aws/s3/tree/branch_node.rb', line 49 def leaf? false end |