Sha256: 611e02df851652269596b7aebcb8b635c0bce5789861c312d4fec6fe0f7d61f4
Contents?: true
Size: 655 Bytes
Versions: 18
Compression:
Stored size: 655 Bytes
Contents
module BPM class Credentials attr_reader :email, :api_key def initialize parse end def save(email, api_key) @email = email @api_key = api_key write end private def write FileUtils.mkdir_p(File.dirname(path)) File.open(path, "w") do |file| file.write YAML.dump(:bpm_api_key => api_key, :bpm_email => email) end end def path LibGems.configuration.credentials_path end def parse if File.exist?(path) hash = YAML.load_file(path) @email = hash[:bpm_email] @api_key = hash[:bpm_api_key] end end end end
Version data entries
18 entries across 18 versions & 1 rubygems