Module: Ynap
- Defined in:
- lib/ynap.rb,
lib/ynap/cli.rb,
lib/ynap/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"1.1.1"
Class Method Summary collapse
- .bank_config(id) ⇒ Object
- .config ⇒ Object
- .config=(path) ⇒ Object
- .plaid_client ⇒ Object
- .regexp ⇒ Object
- .ynab_client ⇒ Object
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 |
.config ⇒ Object
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_client ⇒ Object
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 |
.regexp ⇒ Object
31 32 33 |
# File 'lib/ynap.rb', line 31 def self.regexp @regexp ||= Regexp.union config[:regex].map{ |s| Regexp.new s } end |
.ynab_client ⇒ Object
39 40 41 |
# File 'lib/ynap.rb', line 39 def self.ynab_client @ynab_client ||= YNAB::API.new config.dig(:ynab, :token) end |