Sha256: 21fdf7dc106371b019ac42d69556f94e0fa5abbac3c736d208ddd23e21983269

Contents?: true

Size: 294 Bytes

Versions: 8

Compression:

Stored size: 294 Bytes

Contents

class Array
  # Standard in Ruby 1.8.8. See official documentation[http://ruby-doc.org/core-1.9/classes/Array.html]
  class << self
    def try_convert(obj)
      return nil unless obj.respond_to?(:to_ary)
      Backports.coerce_to_ary(obj)
    end unless method_defined? :try_convert
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
backports-2.3.0 lib/backports/1.9.1/array.rb
backports-2.2.1 lib/backports/1.9.1/array.rb
backports-2.2.0 lib/backports/1.9.1/array.rb
backports-2.1.0 lib/backports/1.8.8/array.rb
backports-2.0.3 lib/backports/1.8.8/array.rb
backports-2.0.2 lib/backports/1.8.8/array.rb
backports-2.0.1 lib/backports/1.8.8/array.rb
backports-2.0.0 lib/backports/1.8.8/array.rb