Class: EnvControl::GetEnvironmentSpecificContract

Inherits:
Object
  • Object
show all
Defined in:
lib/env_control/get_environment_specific_contract.rb

Instance Method Summary collapse

Instance Method Details

#call(env_var:, contracts:, environment_name:) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/env_control/get_environment_specific_contract.rb', line 6

def call(env_var:, contracts:, environment_name:)
  unless environment_name
    raise EnvironmentNameNotConfiguredError.new(context: { env_var: env_var })
  end

  @contracts = contracts

  contract_for(environment_name) || contract_for("default")
end