Class: DevboxLauncher::AccountConfig
- Inherits:
-
Object
- Object
- DevboxLauncher::AccountConfig
- Defined in:
- lib/devbox_launcher/models/account_config.rb
Instance Attribute Summary collapse
-
#account_name ⇒ Object
readonly
Returns the value of attribute account_name.
Instance Method Summary collapse
- #find_box_config(box_name) ⇒ Object
-
#initialize(account_name, config) ⇒ AccountConfig
constructor
A new instance of AccountConfig.
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(account_name, config) @account_name = account_name @config = config end |
Instance Attribute Details
#account_name ⇒ Object (readonly)
Returns the value of attribute account_name.
4 5 6 |
# File 'lib/devbox_launcher/models/account_config.rb', line 4 def account_name @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 #{account_name}" end BoxConfig.new(box_config) end |