lib/currency_cloud/session.rb in currency_cloud-0.9.0 vs lib/currency_cloud/session.rb in currency_cloud-0.10.0
- old
+ new
@@ -8,12 +8,11 @@
attr_reader :environment, :login_id, :api_key
attr_accessor :token, :on_behalf_of
def self.validate_environment(environment)
- unless ENVIRONMENTS.keys.include?(environment)
- raise CurrencyCloud::GeneralError, "'#{environment}' is not a valid environment, must be one of: #{ENVIRONMENTS.keys.join(', ')}"
- end
+ return if ENVIRONMENTS.key?(environment)
+ raise "'#{environment}' is not a valid environment. Must be one of: #{ENVIRONMENTS.keys.join(', ')}"
end
def initialize(environment, login_id, api_key, token)
@environment = environment
@login_id = login_id