Class method
:: try_convert
If obj is a Hash object, returns obj.
How to use
Quick guide
Official content
Official how?
I scraped all this data from the official documentation. I created this site to make it easier for beginners and more pleasant for professionals to use Ruby.
Georgie boy
Creator of ruby-docs.org
If
obj
is a Hash object, returns obj
.Otherwise if
obj
responds to :to_hash
, calls obj.to_hash
and returns the result.Returns
nil
if obj
does not respond to :to_hash
Raises an exception unless
obj.to_hash
returns a Hash object.
static VALUE
rb_hash_s_try_convert(VALUE dummy, VALUE hash)
{
return rb_check_hash_type(hash);
}
Was this page useful?
Leave your feedback
Please hit 'submit' to confirm your feedback.
Leave your feedback
Please hit 'submit' to confirm your feedback.