Class: OPFile
- Inherits:
-
Object
- Object
- OPFile
- Defined in:
- lib/file_sentry/op_file.rb
Instance Attribute Summary collapse
-
#api_wrapper ⇒ Object
Returns the value of attribute api_wrapper.
-
#data_id ⇒ Object
Returns the value of attribute data_id.
-
#file_hash ⇒ Object
Returns the value of attribute file_hash.
-
#filepath ⇒ Object
Returns the value of attribute filepath.
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#scan_results ⇒ Object
Returns the value of attribute scan_results.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ OPFile
constructor
A new instance of OPFile.
- #process_file(encrypt) ⇒ Object
Constructor Details
#initialize(attributes) ⇒ OPFile
Returns a new instance of OPFile.
5 6 7 8 9 |
# File 'lib/file_sentry/op_file.rb', line 5 def initialize(attributes) attributes.each {|attribute, value| self.send("#{attribute}=", value)} self.file_hash ||= FileHash.new({op_file: self}) self.api_wrapper ||= APIWrapper.new({op_file: self}) end |
Instance Attribute Details
#api_wrapper ⇒ Object
Returns the value of attribute api_wrapper.
3 4 5 |
# File 'lib/file_sentry/op_file.rb', line 3 def api_wrapper @api_wrapper end |
#data_id ⇒ Object
Returns the value of attribute data_id.
3 4 5 |
# File 'lib/file_sentry/op_file.rb', line 3 def data_id @data_id end |
#file_hash ⇒ Object
Returns the value of attribute file_hash.
3 4 5 |
# File 'lib/file_sentry/op_file.rb', line 3 def file_hash @file_hash end |
#filepath ⇒ Object
Returns the value of attribute filepath.
3 4 5 |
# File 'lib/file_sentry/op_file.rb', line 3 def filepath @filepath end |
#hash ⇒ Object
Returns the value of attribute hash.
3 4 5 |
# File 'lib/file_sentry/op_file.rb', line 3 def hash @hash end |
#scan_results ⇒ Object
Returns the value of attribute scan_results.
3 4 5 |
# File 'lib/file_sentry/op_file.rb', line 3 def scan_results @scan_results end |
Instance Method Details
#process_file(encrypt) ⇒ Object
11 12 13 14 15 |
# File 'lib/file_sentry/op_file.rb', line 11 def process_file(encrypt) check_file file_hash.hash_file(encrypt) api_wrapper.scan_file end |