Sha256: b3dbf8da7d78d4baa71754d9fd0b78615e5ea08e4eb826cf0655aa75c3b6505c

Contents?: true

Size: 196 Bytes

Versions: 175

Compression:

Stored size: 196 Bytes

Contents

class Range
  def reverse
    first = self.first
    last = self.last
    last..first
  end

  def to_a
    a = super
    if a.empty?
      reverse.to_a.reverse
    else
      a
    end
  end
end

Version data entries

175 entries across 175 versions & 1 rubygems

Version Path
origen-0.54.4 lib/origen/core_ext/range.rb
origen-0.54.3 lib/origen/core_ext/range.rb
origen-0.54.2 lib/origen/core_ext/range.rb
origen-0.54.1 lib/origen/core_ext/range.rb
origen-0.54.0 lib/origen/core_ext/range.rb
origen-0.53.1 lib/origen/core_ext/range.rb
origen-0.53.0 lib/origen/core_ext/range.rb
origen-0.52.4 lib/origen/core_ext/range.rb
origen-0.52.3 lib/origen/core_ext/range.rb
origen-0.52.2 lib/origen/core_ext/range.rb
origen-0.52.1 lib/origen/core_ext/range.rb
origen-0.52.0 lib/origen/core_ext/range.rb
origen-0.51.3 lib/origen/core_ext/range.rb
origen-0.51.2 lib/origen/core_ext/range.rb
origen-0.51.1 lib/origen/core_ext/range.rb
origen-0.51.0 lib/origen/core_ext/range.rb
origen-0.50.0 lib/origen/core_ext/range.rb
origen-0.44.0 lib/origen/core_ext/range.rb
origen-0.43.0 lib/origen/core_ext/range.rb
origen-0.42.2 lib/origen/core_ext/range.rb