Class: Omnizip::Commands::ListCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/omnizip/commands/list_command.rb

Overview

Command to list available compression algorithms.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ListCommand

Initialize list command with options.

Parameters:

  • options (Hash) (defaults to: {})

    Command options from Thor



28
29
30
# File 'lib/omnizip/commands/list_command.rb', line 28

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



23
24
25
# File 'lib/omnizip/commands/list_command.rb', line 23

def options
  @options
end

Instance Method Details

#runvoid

This method returns an undefined value.

Execute the list command.



35
36
37
38
39
# File 'lib/omnizip/commands/list_command.rb', line 35

def run
  algorithms = fetch_algorithms
  output = CliOutputFormatter.format_algorithms_table(algorithms)
  puts output
end