Module: Scalingo::RegionsCache

Included in:
Api
Defined in:
lib/scalingo/regions_cache.rb

Instance Method Summary collapse

Instance Method Details

#region_api_endpoint(name) ⇒ Object

Raises:



3
4
5
6
7
8
9
10
# File 'lib/scalingo/regions_cache.rb', line 3

def region_api_endpoint(name)
  @regions_cache ||= regions.all

  region = @regions_cache.select { |r| r.name == name }.first
  raise InvalidRegion, name if region.nil?

  return "#{region['api']}/v1"
end