Class: DevboxLauncher::AccountConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/devbox_launcher/models/account_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_name, config) ⇒ AccountConfig

Returns a new instance of AccountConfig.



6
7
8
9
# File 'lib/devbox_launcher/models/account_config.rb', line 6

def initialize(, config)
  @account_name = 
  @config = config
end

Instance Attribute Details

#account_nameObject (readonly)

Returns the value of attribute account_name.



4
5
6
# File 'lib/devbox_launcher/models/account_config.rb', line 4

def 
  @account_name
end

Instance Method Details

#find_box_config(box_name) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/devbox_launcher/models/account_config.rb', line 11

def find_box_config(box_name)
  box_config = @config.find { |c| c["box"] == box_name }

  if box_config.nil?
    fail "No box config found for #{box_name} under account #{}"
  end

  BoxConfig.new(box_config)
end