Class: Imap::Backup::CLI::Stats

Inherits:
Thor
  • Object
show all
Includes:
Helpers, Thor::Actions
Defined in:
lib/imap/backup/cli/stats.rb

Overview

Prints various statistics about an account and its backup

Constant Summary

Constants included from Helpers

Helpers::NAMESPACE_CONFIGURATION_DESCRIPTION

Instance Method Summary collapse

Methods included from Helpers

#account, included, #load_config, #requested_accounts

Constructor Details

#initialize(email, options) ⇒ Stats

Returns a new instance of Stats.

Parameters:

  • email (String)

    the email address identifying the account to inspect

  • options (Hash)

    CLI options controlling output

  • opts (Hash)

    a customizable set of options



22
23
24
25
26
# File 'lib/imap/backup/cli/stats.rb', line 22

def initialize(email, options)
  super([])
  @email = email
  @options = options
end

Instance Method Details

#runvoid

This method returns an undefined value.



30
31
32
33
34
35
36
37
38
39
# File 'lib/imap/backup/cli/stats.rb', line 30

no_commands do
  def run
    case options[:format]
    when "json"
      Kernel.puts stats.to_json
    else
      format_text stats
    end
  end
end