class AWS::S3::Tree::BranchNode
Represents a branch in an {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.
@see Tree
@note Generally you do not need to create branch nodes.
Attributes
parent[R]
@return [Tree, BranchNode] The parent node in the tree.
Public Class Methods
new(parent, collection, options = {})
click to toggle source
@private
Calls superclass method
AWS::S3::Tree::Parent::new
# File lib/aws/s3/tree/branch_node.rb, line 34 def initialize parent, collection, options = {} @parent = parent super(collection, options.merge(:prefix => collection.prefix)) end
Public Instance Methods
as_tree()
click to toggle source
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.
@return [Tree]
# File lib/aws/s3/tree/branch_node.rb, line 58 def as_tree Tree.new(collection, :prefix => prefix, :delimiter => delimiter, :append => append?) end
branch?()
click to toggle source
@return [true]
# File lib/aws/s3/tree/branch_node.rb, line 44 def branch? true end
leaf?()
click to toggle source
@return [false]
# File lib/aws/s3/tree/branch_node.rb, line 49 def leaf? false end