Class: JCF::Plugins::AwsS3
- Inherits:
-
Object
- Object
- JCF::Plugins::AwsS3
- Defined in:
- lib/jcf/plugins/aws_s3.rb
Instance Method Summary collapse
-
#initialize(name:) ⇒ AwsS3
constructor
A new instance of AwsS3.
- #metrics ⇒ Object
- #names ⇒ Object
- #to_s ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(name:) ⇒ AwsS3
Returns a new instance of AwsS3.
11 12 13 14 15 |
# File 'lib/jcf/plugins/aws_s3.rb', line 11 def initialize(name:) @name = name @metrics = {} check_token! end |
Instance Method Details
#metrics ⇒ Object
25 26 27 28 |
# File 'lib/jcf/plugins/aws_s3.rb', line 25 def metrics @metrics[:storage_used] = to_gb(s3_storage_used(name: @name || "")) @metrics end |
#names ⇒ Object
17 18 19 |
# File 'lib/jcf/plugins/aws_s3.rb', line 17 def names %w[storage_used] end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/jcf/plugins/aws_s3.rb', line 30 def to_s metrics.to_s end |
#values ⇒ Object
21 22 23 |
# File 'lib/jcf/plugins/aws_s3.rb', line 21 def values names.map { |name| send(name.to_sym) } end |