Class: Awshark::S3::Bucket
- Inherits:
-
Object
- Object
- Awshark::S3::Bucket
- Defined in:
- lib/awshark/s3/bucket.rb
Instance Attribute Summary collapse
-
#creation_date ⇒ Object
readonly
Returns the value of attribute creation_date.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
- #byte_size ⇒ Object
-
#initialize(attributes) ⇒ Bucket
constructor
A new instance of Bucket.
- #number_of_objects ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Bucket
Returns a new instance of Bucket.
8 9 10 11 12 13 14 15 |
# File 'lib/awshark/s3/bucket.rb', line 8 def initialize(attributes) @name = attributes.name @creation_date = attributes.creation_date @region = attributes.region # fixes S3 quirks @region = 'eu-west-1' if @region == 'EU' end |
Instance Attribute Details
#creation_date ⇒ Object (readonly)
Returns the value of attribute creation_date.
6 7 8 |
# File 'lib/awshark/s3/bucket.rb', line 6 def creation_date @creation_date end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/awshark/s3/bucket.rb', line 6 def name @name end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
6 7 8 |
# File 'lib/awshark/s3/bucket.rb', line 6 def region @region end |
Instance Method Details
#byte_size ⇒ Object
17 18 19 |
# File 'lib/awshark/s3/bucket.rb', line 17 def byte_size metric_value(metric_name: 'BucketSizeBytes', storage_type: 'StandardStorage') end |
#number_of_objects ⇒ Object
21 22 23 |
# File 'lib/awshark/s3/bucket.rb', line 21 def number_of_objects metric_value(metric_name: 'NumberOfObjects', storage_type: 'AllStorageTypes') end |