class Toggl::Jobcan::Credentials

Jobcan credentials manager

Constants

ATTRS

Attributes

email[RW]
password[RW]

Public Class Methods

load_config(path) click to toggle source
# File lib/toggl/jobcan/credentials.rb, line 21
def load_config(path)
  YAML.safe_load(File.open(path).read).transform_keys(&:to_sym)
end
new(args) click to toggle source
# File lib/toggl/jobcan/credentials.rb, line 14
def initialize(args)
  attr_set(args) if args.key?(:email)
  c = self.class.load_config(args[:path])
  attr_set(c)
end

Private Instance Methods

attr_set(hash) click to toggle source
# File lib/toggl/jobcan/credentials.rb, line 28
def attr_set(hash)
  ATTRS.each { |k| send((k.to_s + '=').to_sym, hash[k]) }
end