diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-21 12:41:34 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-21 12:41:34 +0000 |
commit | 07a6b4cbb509f113747cf2f77a6a6a34c9a7e7d2 (patch) | |
tree | 608e4135c7b2de757fd1131e571fe6085682fc72 /ext/digest/lib | |
parent | 51d586c64e19c13a6fdfc75a860247f0835ef1a7 (diff) | |
download | ruby-07a6b4cbb509f113747cf2f77a6a6a34c9a7e7d2.tar.gz |
* ext/digest/lib/digest.rb (Digest::Class.file): Take optional
arguments that are passed to the constructor of the digest
class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/lib')
-rw-r--r-- | ext/digest/lib/digest.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/digest/lib/digest.rb b/ext/digest/lib/digest.rb index 4a98af2eae..83630f45d1 100644 --- a/ext/digest/lib/digest.rb +++ b/ext/digest/lib/digest.rb @@ -22,11 +22,13 @@ module Digest class ::Digest::Class # creates a digest object and reads a given file, _name_. + # Optional arguments are passed to the constructor of the digest + # class. # # p Digest::SHA256.file("X11R6.8.2-src.tar.bz2").hexdigest # # => "f02e3c85572dc9ad7cb77c2a638e3be24cc1b5bea9fdbb0b0299c9668475c534" - def self.file(name) - new.file(name) + def self.file(name, *args) + new(*args).file(name) end # Returns the base64 encoded hash value of a given _string_. The |