Class: Host
- Inherits:
-
Object
- Object
- Host
- Defined in:
- lib/open-dock/providers.rb
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
-
#initialize(host_name) ⇒ Host
constructor
A new instance of Host.
Constructor Details
#initialize(host_name) ⇒ Host
Returns a new instance of Host.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/open-dock/providers.rb', line 48 def initialize(host_name) @host = host_name config_file = "#{Ops::HOSTS_DIR}/#{host_name}.yml" begin @config = YAML.load_file "#{config_file}" @config["name"]= host_name rescue raise "Please, create '#{config_file}' file with token value" end @provider = ProviderFactory.build @config["provider"] end |
Instance Method Details
#create ⇒ Object
59 60 61 |
# File 'lib/open-dock/providers.rb', line 59 def create @provider.create @config end |
#delete ⇒ Object
62 63 64 |
# File 'lib/open-dock/providers.rb', line 62 def delete @provider.delete @host end |