Method: Fulmar::Domain::Model::Configuration#set

Defined in:
lib/fulmar/domain/model/configuration.rb

#set(environment, target = nil) ⇒ Object

Set the environment and target in one call



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fulmar/domain/model/configuration.rb', line 39

def set(environment, target = nil)
  # For convenience, allow something like "environment:target" as string
  if environment.class == String
    fields = environment.split(':')
    @environment = fields.first.to_sym
    @target = fields.size > 1 ? fields[1].to_sym : nil
  else
    @environment = environment
    @target = target unless target.nil?
  end
end