Module: Ynap

Defined in:
lib/ynap.rb,
lib/ynap/cli.rb,
lib/ynap/version.rb

Defined Under Namespace

Classes: CLI, Error

Constant Summary collapse

VERSION =
"1.1.1"

Class Method Summary collapse

Class Method Details

.bank_config(id) ⇒ Object



27
28
29
# File 'lib/ynap.rb', line 27

def self.bank_config(id)
  config[:banks].find { |bank_params| bank_params[:id] == id }
end

.configObject



19
20
21
# File 'lib/ynap.rb', line 19

def self.config
  @config ||= YAML.load(File.read('ynap.yml'))
end

.config=(path) ⇒ Object



23
24
25
# File 'lib/ynap.rb', line 23

def self.config=(path)
  @config = YAML.load(File.read(path))
end

.plaid_clientObject



35
36
37
# File 'lib/ynap.rb', line 35

def self.plaid_client
  @plaid_client ||= Plaid::Client.new config[:plaid].slice(:env, :client_id, :secret)
end

.regexpObject



31
32
33
# File 'lib/ynap.rb', line 31

def self.regexp
  @regexp ||= Regexp.union config[:regex].map{ |s| Regexp.new s }
end

.ynab_clientObject



39
40
41
# File 'lib/ynap.rb', line 39

def self.ynab_client
  @ynab_client  ||= YNAB::API.new config.dig(:ynab, :token)
end