Class: AWSCosts::S3

Inherits:
Object
  • Object
show all
Defined in:
lib/awscosts/s3.rb

Constant Summary collapse

REGION_MAPPING =
{
     'us-east-1' => "us-std",
     'us-west-1' => "us-west-1",
     'us-west-2' => "us-west-2",
     'eu-west-1' => "eu-west-1",
      'eu-central-1' => "eu-central-1",
     'ap-southeast-1' => "ap-southeast-1",
     'ap-southeast-2' =>"ap-southeast-2",
     'ap-northeast-1' =>"ap-northeast-1",
     'sa-east-1' => "sa-east-1"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(region) ⇒ S3

Returns a new instance of S3.



21
22
23
# File 'lib/awscosts/s3.rb', line 21

def initialize region
  @region = REGION_MAPPING[region.name]
end

Instance Attribute Details

#regionObject (readonly)

Returns the value of attribute region.



7
8
9
# File 'lib/awscosts/s3.rb', line 7

def region
  @region
end

Instance Method Details

#data_transferObject



29
30
31
# File 'lib/awscosts/s3.rb', line 29

def data_transfer
  AWSCosts::S3DataTransfer.fetch(@region)
end

#requestsObject



33
34
35
# File 'lib/awscosts/s3.rb', line 33

def requests
  AWSCosts::S3Requests.fetch(@region)
end

#storageObject



25
26
27
# File 'lib/awscosts/s3.rb', line 25

def storage
  AWSCosts::S3Storage.fetch(@region)
end