Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v2.0.1
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (21 sloc) 0.596 kb
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Range #:nodoc:
# Return an array when step is called without a block.
module BlocklessStep
def self.included(base) #:nodoc:
base.alias_method_chain :step, :blockless
end
def step_with_blockless(value, &block)
if block_given?
step_without_blockless(value, &block)
else
returning [] do |array|
step_without_blockless(value) { |step| array << step }
end
end
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.