Class: Obfusc::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/obfusc/cli.rb

Overview

This model receive and process ARGV from ./exe/obfusc script

Constant Summary collapse

VALID_COMMANDS =
%w[setup crypt decrypt show].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ CLI

Returns a new instance of CLI.



10
11
12
13
# File 'lib/obfusc/cli.rb', line 10

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

Instance Attribute Details

#argumetnsObject (readonly)

Returns the value of attribute argumetns.



8
9
10
# File 'lib/obfusc/cli.rb', line 8

def argumetns
  @argumetns
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/obfusc/cli.rb', line 8

def options
  @options
end

Instance Method Details

#runObject



15
16
17
18
# File 'lib/obfusc/cli.rb', line 15

def run
  configure
  perform(@arguments.shift)
end