Class: JCF::Plugins::AwsS3

Inherits:
Object
  • Object
show all
Defined in:
lib/jcf/plugins/aws_s3.rb

Instance Method Summary collapse

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

#metricsObject



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

#namesObject



17
18
19
# File 'lib/jcf/plugins/aws_s3.rb', line 17

def names
  %w[storage_used]
end

#to_sObject



30
31
32
# File 'lib/jcf/plugins/aws_s3.rb', line 30

def to_s
  metrics.to_s
end

#valuesObject



21
22
23
# File 'lib/jcf/plugins/aws_s3.rb', line 21

def values
  names.map { |name| send(name.to_sym) }
end