aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/range/blockless_step.rb
blob: f687287f0d145c7937d2156c45e4f09580b11be6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                 
           




                                                 

       

                                      
   
require 'active_support/core_ext/module/aliasing'

class Range
  def step_with_blockless(*args, &block) #:nodoc:
    if block_given?
      step_without_blockless(*args, &block)
    else
      step_without_blockless(*args).to_a
    end
  end

  alias_method_chain :step, :blockless
end