Class: Oc::Config

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

Class Method Summary collapse

Class Method Details

.get(key) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/system/config.rb', line 6

def self.get(key)
  config = Netrc.read("#{(ENV["HOME"] || "./")}/oc.netrc")
  config = config["api.digitalocean.com"]
  options = {
    :api_key => config[0]
  }
  return options[:"#{key}"]
end

.get_bargeObject



14
15
16
# File 'lib/system/config.rb', line 14

def self.get_barge
  barge = ::Barge::Client.new(access_token: self.get(:api_key))
end