Sha256: b0ba3956f5d74e56c8f417494b75261d349f6fe2fc72cce29dc170e948c65263
Contents?: true
Size: 654 Bytes
Versions: 4
Compression:
Stored size: 654 Bytes
Contents
require "myfinance/request" require "myfinance/response" module Myfinance class Client attr_reader :http def initialize(token, account_id = nil) @http = Http.new(token, account_id) end def authenticated? http.get("/accounts") { |response| response.code == 200 } rescue RequestError => e raise e unless [401, 403].include?(e.code) false end def entities Myfinance::Resources::Entity.new(http) end def payable_accounts Myfinance::Resources::PayableAccount.new(http) end def receivable_accounts Myfinance::Resources::ReceivableAccount.new(http) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
myfinance-0.3.3 | lib/myfinance/client.rb |
myfinance-0.3.2 | lib/myfinance/client.rb |
myfinance-0.3.1 | lib/myfinance/client.rb |
myfinance-0.3.0 | lib/myfinance/client.rb |