Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #639 from kachick/implement-string,hash-try_convert
Implement String.try_convert, Hash.try_convert
- Loading branch information
Showing
with
12 additions
and 14 deletions.
@@ -1,8 +1 @@ | ||
fails:Hash.try_convert returns the argument if it's a Hash | ||
fails:Hash.try_convert returns the argument if it's a kind of Hash | ||
fails:Hash.try_convert returns nil when the argument does not respond to #to_hash | ||
fails:Hash.try_convert sends #to_hash to the argument and returns the result if it's nil | ||
fails:Hash.try_convert sends #to_hash to the argument and returns the result if it's a Hash | ||
fails:Hash.try_convert sends #to_hash to the argument and returns the result if it's a kind of Hash | ||
fails:Hash.try_convert sends #to_hash to the argument and raises TypeError if it's not a kind of Hash | ||
fails:Hash.try_convert does not rescue exceptions raised by #to_hash |
@@ -1,8 +1 @@ | ||
fails:String.try_convert returns the argument if it's a String | ||
fails:String.try_convert returns the argument if it's a kind of String | ||
fails:String.try_convert returns nil when the argument does not respond to #to_str | ||
fails:String.try_convert sends #to_str to the argument and returns the result if it's nil | ||
fails:String.try_convert sends #to_str to the argument and returns the result if it's a String | ||
fails:String.try_convert sends #to_str to the argument and returns the result if it's a kind of String | ||
fails:String.try_convert sends #to_str to the argument and raises TypeError if it's not a kind of String | ||
fails:String.try_convert does not rescue exceptions raised by #to_str |