Class: FileHash
- Inherits:
-
Object
- Object
- FileHash
- Defined in:
- lib/file_sentry/file_hash.rb
Instance Attribute Summary collapse
-
#op_file ⇒ Object
Returns the value of attribute op_file.
Instance Method Summary collapse
- #hash_file(encryption) ⇒ Object
-
#initialize(attributes) ⇒ FileHash
constructor
A new instance of FileHash.
Constructor Details
#initialize(attributes) ⇒ FileHash
Returns a new instance of FileHash.
5 6 7 |
# File 'lib/file_sentry/file_hash.rb', line 5 def initialize(attributes) attributes.each {|attribute, value| self.send("#{attribute}=", value)} end |
Instance Attribute Details
#op_file ⇒ Object
Returns the value of attribute op_file.
3 4 5 |
# File 'lib/file_sentry/file_hash.rb', line 3 def op_file @op_file end |
Instance Method Details
#hash_file(encryption) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/file_sentry/file_hash.rb', line 9 def hash_file(encryption) begin self.send("digest_#{encryption.downcase}") rescue raise "No encryption found for: #{encryption}" end end |