Class: InlineEncryption::CLI

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

Instance Method Summary collapse

Constructor Details

#initialize(args = [], opts = [], config = {}) ⇒ CLI

Returns a new instance of CLI.



9
10
11
12
13
14
15
# File 'lib/inline_encryption/cli.rb', line 9

def initialize(args=[], opts=[], config={})
  super(args, opts, config)

  if options[:config] && File.exists?(options[:config])
    @options = YAML.load_file(options[:config]).symbolize_keys.merge(@options.symbolize_keys)
  end
end

Instance Method Details

#encrypt(data) ⇒ Object



20
21
22
23
24
25
# File 'lib/inline_encryption/cli.rb', line 20

def encrypt(data)
  #puts options
  load_enviroment(options[:require])

  puts InlineEncryption.encrypt(data)
end