Sha256: dadb3beafe2c8b908c22461a5a922033bc7793e29ab0832fa3fdbf4f9dd78cfc
Contents?: true
Size: 732 Bytes
Versions: 6
Compression:
Stored size: 732 Bytes
Contents
# typed: false # frozen_string_literal: true require_relative '../command' require_relative '../api/wallet' require 'yaml' require 'tty-table' module Moneylovercli module Commands class Wallets < Moneylovercli::Command def initialize(options) super @options = options end def execute(_input: $stdin, output: $stdout) config = YAML.load_file('config.yml') access_token = config['access_token'] wallets = Moneylovercli::Api::Wallet.new(token: access_token) .list .parsed_response output.puts TTY::Table.new( %w[ID Name], wallets['data'].map { |data| [data['_id'], data['name']] } ) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems