Class: Ec2spec::OfferIndexFile

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/ec2spec/offer_index_file.rb

Constant Summary collapse

REGION_INDEX_FILE_URL =
'https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/region_index.json'

Instance Method Summary collapse

Instance Method Details

#offer_file_url(region) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/ec2spec/offer_index_file.rb', line 9

def offer_file_url(region)
  offer_index_file_json

  file_path = @offer_index_file_json['regions'][region]['currentVersionUrl']
  parsed_url = URI.parse(REGION_INDEX_FILE_URL)
  parsed_url.path = file_path
  parsed_url.to_s
end