Sha256: 1ff0a4af5958dae23201678aa86160a3763eec8be55d258501f2614f95a0627d

Contents?: true

Size: 401 Bytes

Versions: 13

Compression:

Stored size: 401 Bytes

Contents

module Gibbon
  module Helpers
    def get_data_center_from_api_key(api_key)
      # Return an empty string for invalid API keys so Gibbon hits the main endpoint
      data_center = ""

      if api_key && api_key["-"]
        # Add a period since the data_center is a subdomain and it keeps things dry
        data_center = "#{api_key.split('-').last}."
      end

      data_center
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gibbon-3.4.3 lib/gibbon/gibbon_helpers.rb
gibbon-3.4.2 lib/gibbon/gibbon_helpers.rb
gibbon-3.4.0 lib/gibbon/gibbon_helpers.rb
gibbon-3.3.4 lib/gibbon/gibbon_helpers.rb
gibbon-3.3.3 lib/gibbon/gibbon_helpers.rb
gibbon-3.3.2 lib/gibbon/gibbon_helpers.rb
gibbon-3.3.1 lib/gibbon/gibbon_helpers.rb
gibbon-3.3.0 lib/gibbon/gibbon_helpers.rb
gibbon-3.2.0 lib/gibbon/gibbon_helpers.rb
gibbon-3.1.1 lib/gibbon/gibbon_helpers.rb
gibbon-3.1.0 lib/gibbon/gibbon_helpers.rb
gibbon-3.0.2 lib/gibbon/gibbon_helpers.rb
gibbon-3.0.1 lib/gibbon/gibbon_helpers.rb