Class: CommandLine

Inherits:
Object
  • Object
show all
Defined in:
lib/file_sentry/command_line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ CommandLine

Returns a new instance of CommandLine.



4
5
6
7
# File 'lib/file_sentry/command_line.rb', line 4

def initialize(attributes)
  attributes.each {|attribute, value| self.send("#{attribute}=", value) }
  self.op_file = OPFile.new({filepath: filepath})
end

Instance Attribute Details

#encryptionObject

Returns the value of attribute encryption.



2
3
4
# File 'lib/file_sentry/command_line.rb', line 2

def encryption
  @encryption
end

#filepathObject

Returns the value of attribute filepath.



2
3
4
# File 'lib/file_sentry/command_line.rb', line 2

def filepath
  @filepath
end

#op_fileObject

Returns the value of attribute op_file.



2
3
4
# File 'lib/file_sentry/command_line.rb', line 2

def op_file
  @op_file
end

Instance Method Details

#start_utilityObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/file_sentry/command_line.rb', line 9

def start_utility
  key = load_api_key
  config_app(key)
  op_file.filepath = filepath
  if filepath
    analyze_file
  else
    show_usage
    show_config
  end
end