summaryrefslogtreecommitdiff
path: root/ext/digest/bubblebabble/bubblebabble.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-13 19:40:01 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-13 19:40:01 +0000
commitbf8cd1e929d3f1ad2c1a6aefda9da08ebdc11d05 (patch)
treed3118762f605a54c49144c01b9b48826c72d22d0 /ext/digest/bubblebabble/bubblebabble.c
parent703d2d1612beb26a7449566f8d6c1f868865fc46 (diff)
* ext/digest/digest.c: Improve RDoc documentation.
* ext/digest/digest.c (Init_digest, rb_digest_base_s_digest, rb_digest_base_s_hexdigest): Make Digest::Base::digest() and Digest::Base::hexdigest() take extra arguments, which are passed through to the constructor in an internal call. * ext/digest/bubblebabble/bubblebabble.c (rb_digest_base_s_bubblebabble): Ditto for Digest::Base::bubblebabble(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/bubblebabble/bubblebabble.c')
-rw-r--r--ext/digest/bubblebabble/bubblebabble.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/digest/bubblebabble/bubblebabble.c b/ext/digest/bubblebabble/bubblebabble.c
index 1e882cce0e5..a7e4d9f7d60 100644
--- a/ext/digest/bubblebabble/bubblebabble.c
+++ b/ext/digest/bubblebabble/bubblebabble.c
@@ -82,7 +82,11 @@ bubblebabble_str_new(VALUE str_digest)
* call-seq:
* Digest.bubblebabble(string) -> bubblebabble_string
*
- * Returns a BubbleBabble encoded version of a given _string_. */
+ * Returns a BubbleBabble encoded version of a given _string_.
+ *
+ * If extra arguments are given, they are passed to
+ * Digest::ALGORITHM.digest() along with the _string_.
+ */
static VALUE
rb_digest_s_bubblebabble(VALUE klass, VALUE str)
{
@@ -91,14 +95,14 @@ rb_digest_s_bubblebabble(VALUE klass, VALUE str)
/*
* call-seq:
- * Digest::ALGORITHM.bubblebabble(string) -> hash_string
+ * Digest::ALGORITHM.bubblebabble(string, ...) -> hash_string
*
* Returns the BubbleBabble encoded hash value of a given _string_.
*/
static VALUE
-rb_digest_base_s_bubblebabble(VALUE klass, VALUE str)
+rb_digest_base_s_bubblebabble(int argc, VALUE *argv, VALUE klass)
{
- return bubblebabble_str_new(rb_funcall(klass, id_digest, 1, str));
+ return bubblebabble_str_new(rb_funcall2(klass, id_digest, argc, argv));
}
/*
@@ -127,7 +131,7 @@ Init_bubblebabble(void)
rb_define_module_function(mDigest, "bubblebabble", rb_digest_s_bubblebabble, 1);
/* Digest::Base::bubblebabble() */
- rb_define_singleton_method(cDigest_Base, "bubblebabble", rb_digest_base_s_bubblebabble, 1);
+ rb_define_singleton_method(cDigest_Base, "bubblebabble", rb_digest_base_s_bubblebabble, -1);
/* Digest::Base#bubblebabble() */
rb_define_method(cDigest_Base, "bubblebabble", rb_digest_base_bubblebabble, 0);