diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-19 22:01:28 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-19 12:08:28 +0900 |
| commit | 5bbcea9b3bdb0e7dc048f92cebefb54858196935 (patch) | |
| tree | a9d314112808837e9475ff618244a255d0e0b16e /mrbgems/mruby-array-ext/mrblib/array.rb | |
| parent | b5d43a16a38d522aa1d1d1a889585749a6b8086d (diff) | |
| download | mruby-5bbcea9b3bdb0e7dc048f92cebefb54858196935.tar.gz mruby-5bbcea9b3bdb0e7dc048f92cebefb54858196935.zip | |
Removed `try_convert` method from Array and Hash.
Diffstat (limited to 'mrbgems/mruby-array-ext/mrblib/array.rb')
| -rw-r--r-- | mrbgems/mruby-array-ext/mrblib/array.rb | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/mrbgems/mruby-array-ext/mrblib/array.rb b/mrbgems/mruby-array-ext/mrblib/array.rb index 42da0207e..54d62e3fd 100644 --- a/mrbgems/mruby-array-ext/mrblib/array.rb +++ b/mrbgems/mruby-array-ext/mrblib/array.rb @@ -1,31 +1,6 @@ class Array ## # call-seq: - # Array.try_convert(obj) -> array or nil - # - # Tries to convert +obj+ into an array, using +to_ary+ method. - # converted array or +nil+ if +obj+ cannot be converted for any reason. - # This method can be used to check if an argument is an array. - # - # Array.try_convert([1]) #=> [1] - # Array.try_convert("1") #=> nil - # - # if tmp = Array.try_convert(arg) - # # the argument is an array - # elsif tmp = String.try_convert(arg) - # # the argument is a string - # end - # - def self.try_convert(obj) - if obj.respond_to?(:to_ary) - obj.to_ary - else - nil - end - end - - ## - # call-seq: # ary.uniq! -> ary or nil # ary.uniq! { |item| ... } -> ary or nil # |
