Class: TokenHawk::CLI::Commands::Costs

Inherits:
Object
  • Object
show all
Includes:
Formatter
Defined in:
lib/token_hawk/cli/commands/costs.rb

Instance Method Summary collapse

Methods included from Formatter

#format_cost

Constructor Details

#initialize(options = {}) ⇒ Costs

Returns a new instance of Costs.



11
12
13
# File 'lib/token_hawk/cli/commands/costs.rb', line 11

def initialize(options = {})
  @options = options
end

Instance Method Details

#run ⇒ Object



15
16
17
18
# File 'lib/token_hawk/cli/commands/costs.rb', line 15

def run
  results = grouped_results(scoped_records)
  @options["format"] == "json" ? print_json(results) : print_table(results)
end