Sha256: fbe4e9274c6cefe6f7513dc2bea0565d85e59675d162df76ea1d621b89a27b86

Contents?: true

Size: 596 Bytes

Versions: 19

Compression:

Stored size: 596 Bytes

Contents

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

Version data entries

19 entries across 19 versions & 4 rubygems

Version Path
activesupport-2.0.1 lib/active_support/core_ext/range/blockless_step.rb
activesupport-2.0.0 lib/active_support/core_ext/range/blockless_step.rb
activesupport-2.0.2 lib/active_support/core_ext/range/blockless_step.rb
radiant-0.6.5.1 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
radiant-0.6.5 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
radiant-0.6.7 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
radiant-0.6.6 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
radiant-0.6.9 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
radiant-0.6.8 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
spree-0.0.9 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
spree-0.2.0 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
swivel-0.0.149 vendor/activesupport-2.0.2-/lib/active_support/core_ext/range/blockless_step.rb
swivel-0.0.150 vendor/activesupport-2.0.2-/lib/active_support/core_ext/range/blockless_step.rb
swivel-0.0.152 vendor/activesupport-2.0.2-/lib/active_support/core_ext/range/blockless_step.rb
swivel-0.0.156 vendor/activesupport-2.0.2-/lib/active_support/core_ext/range/blockless_step.rb
swivel-0.0.157 vendor/activesupport-2.0.2-/lib/active_support/core_ext/range/blockless_step.rb
swivel-0.0.160 vendor/activesupport-2.0.2-/lib/active_support/core_ext/range/blockless_step.rb
swivel-0.0.155 vendor/activesupport-2.0.2-/lib/active_support/core_ext/range/blockless_step.rb
swivel-0.0.175 vendor/activesupport-2.0.2-/lib/active_support/core_ext/range/blockless_step.rb