Class: Vagrant::Smartos::Zones::Util::Checksum
- Inherits:
-
Object
- Object
- Vagrant::Smartos::Zones::Util::Checksum
- Defined in:
- lib/vagrant/smartos/zones/util/checksum.rb
Instance Attribute Summary collapse
-
#checksum ⇒ Object
readonly
Returns the value of attribute checksum.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, checksum) ⇒ Checksum
constructor
A new instance of Checksum.
- #valid? ⇒ Boolean
Constructor Details
#initialize(path, checksum) ⇒ Checksum
Returns a new instance of Checksum.
10 11 12 13 |
# File 'lib/vagrant/smartos/zones/util/checksum.rb', line 10 def initialize(path, checksum) @path = path @checksum = checksum end |
Instance Attribute Details
#checksum ⇒ Object (readonly)
Returns the value of attribute checksum.
8 9 10 |
# File 'lib/vagrant/smartos/zones/util/checksum.rb', line 8 def checksum @checksum end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/vagrant/smartos/zones/util/checksum.rb', line 8 def path @path end |
Instance Method Details
#valid? ⇒ Boolean
15 16 17 |
# File 'lib/vagrant/smartos/zones/util/checksum.rb', line 15 def valid? Digest::MD5.file(path) == checksum end |