Class: DevboxLauncher::BoxConfig

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

Constant Summary collapse

DEFAULT_IDENTIFY_FILE_PATH =
"~/.ssh/google_compute_engine".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ BoxConfig

Returns a new instance of BoxConfig.



8
9
10
# File 'lib/devbox_launcher/models/box_config.rb', line 8

def initialize(config)
  @config = config.with_indifferent_access
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end

Instance Method Details

#identity_fileObject



28
29
30
# File 'lib/devbox_launcher/models/box_config.rb', line 28

def identity_file
  config[:identity_file] || DEFAULT_IDENTIFY_FILE_PATH
end

#mutagen_configObject



12
13
14
# File 'lib/devbox_launcher/models/box_config.rb', line 12

def mutagen_config
  MutagenConfig.new(config[:mutagen])
end

#projectObject



16
17
18
# File 'lib/devbox_launcher/models/box_config.rb', line 16

def project
  config[:project]
end

#userObject



24
25
26
# File 'lib/devbox_launcher/models/box_config.rb', line 24

def user
  config[:user]
end

#zoneObject



20
21
22
# File 'lib/devbox_launcher/models/box_config.rb', line 20

def zone
  config[:zone]
end