Class: Tenderloin::Config::Top

Inherits:
Base
  • Object
show all
Defined in:
lib/tenderloin/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #instance_variables_hash, #to_json

Constructor Details

#initializeTop

Returns a new instance of Top.



130
131
132
133
134
135
136
137
138
139
# File 'lib/tenderloin/config.rb', line 130

def initialize
  @ssh = SSHConfig.new
  @vm = VMConfig.new
  @tenderloin = TenderloinConfig.new
  @package = PackageConfig.new
  @provisioning = ProvisioningConfig.new
  @shared_folders = SharedFoldersConfig.new

  @loaded = false
end

Instance Attribute Details

#packageObject (readonly)

Returns the value of attribute package.



123
124
125
# File 'lib/tenderloin/config.rb', line 123

def package
  @package
end

#provisioningObject (readonly)

Returns the value of attribute provisioning.



127
128
129
# File 'lib/tenderloin/config.rb', line 127

def provisioning
  @provisioning
end

#shared_foldersObject (readonly)

Returns the value of attribute shared_folders.



128
129
130
# File 'lib/tenderloin/config.rb', line 128

def shared_folders
  @shared_folders
end

#sshObject (readonly)

Returns the value of attribute ssh.



124
125
126
# File 'lib/tenderloin/config.rb', line 124

def ssh
  @ssh
end

#tenderloinObject (readonly)

Returns the value of attribute tenderloin.



126
127
128
# File 'lib/tenderloin/config.rb', line 126

def tenderloin
  @tenderloin
end

#vmObject (readonly)

Returns the value of attribute vm.



125
126
127
# File 'lib/tenderloin/config.rb', line 125

def vm
  @vm
end

Instance Method Details

#loaded!Object



145
146
147
# File 'lib/tenderloin/config.rb', line 145

def loaded!
  @loaded = true
end

#loaded?Boolean

Returns:

  • (Boolean)


141
142
143
# File 'lib/tenderloin/config.rb', line 141

def loaded?
  @loaded
end

#to_hashObject



149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/tenderloin/config.rb', line 149

def to_hash
  hsh = Tenderloin.config.instance_variables_hash
  hsh.delete(:tenderloin)
  hsh = hsh.inject({}) do |h, (k, iv)|
    if iv.class.to_s =~ /Tenderloin::Config/
      h[k] = iv.instance_variables_hash
    else
      h[k] = iv
    end
    h
  end
  hsh
end