Class: AWS::S3::Tree::LeafNode
- Inherits:
-
Node
- Object
- Node
- AWS::S3::Tree::LeafNode
- Defined in:
- lib/aws/s3/tree/leaf_node.rb
Overview
Note:
Generally you do not need to create leaf nodes
Represents a leaf in an AWS::S3::Tree.
When enumerating nodes in an S3 tree, keys are yielded as leaf nodes (they have no children beneath them).
Instance Attribute Summary collapse
-
#member ⇒ mixed
readonly
Returns the object this leaf node represents.
-
#parent ⇒ Tree, BranchNode
readonly
The parent node in the tree.
Instance Method Summary collapse
- #branch? ⇒ false
- #inspect ⇒ Object
-
#key ⇒ String
The key this leaf node represents.
- #leaf? ⇒ true
-
#object ⇒ S3Object
The object this leaf node represents.
-
#upload ⇒ MultipartUpload
Returns the object version this leaf node represents.
-
#version ⇒ ObjectVersion
Returns the object version this leaf node represents.
Instance Attribute Details
#member ⇒ mixed (readonly)
Returns the object this leaf node represents.
46 47 48 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 46 def member @member end |
#parent ⇒ Tree, BranchNode (readonly)
Returns The parent node in the tree.
40 41 42 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 40 def parent @parent end |
Instance Method Details
#branch? ⇒ false
54 55 56 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 54 def branch? false end |
#inspect ⇒ Object
92 93 94 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 92 def inspect "<#{self.class}:#{@member.bucket.name}:#{key}>" end |
#key ⇒ String
Returns the key this leaf node represents.
49 50 51 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 49 def key @member.key end |
#leaf? ⇒ true
59 60 61 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 59 def leaf? true end |
#object ⇒ S3Object
Returns The object this leaf node represents.
64 65 66 67 68 69 70 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 64 def object if @member.kind_of?(S3Object) @member else @member.object end end |
#upload ⇒ MultipartUpload
Returns the object version this leaf node represents.
84 85 86 87 88 89 90 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 84 def upload if @member.kind_of?(MultipartUpload) @member else raise "This leaf does not represent an upload" end end |
#version ⇒ ObjectVersion
Returns the object version this leaf node represents.
74 75 76 77 78 79 80 |
# File 'lib/aws/s3/tree/leaf_node.rb', line 74 def version if @member.kind_of?(ObjectVersion) @member else raise "This leaf does not represent a version" end end |