Sha256: 15197ef5ce40523ea78e928b4b99fc83217d715fef5e0729eca37bb5cb9e138c

Contents?: true

Size: 407 Bytes

Versions: 75

Compression:

Stored size: 407 Bytes

Contents

module ActiveSupport
  module EachTimeWithZone #:nodoc:
    def each(&block)
      ensure_iteration_allowed
      super
    end

    def step(n = 1, &block)
      ensure_iteration_allowed
      super
    end

    private

      def ensure_iteration_allowed
        raise TypeError, "can't iterate from #{first.class}" if first.is_a?(Time)
      end
  end
end

Range.prepend(ActiveSupport::EachTimeWithZone)

Version data entries

75 entries across 72 versions & 9 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/range/each.rb
activesupport-5.1.7 lib/active_support/core_ext/range/each.rb
activesupport-5.1.7.rc1 lib/active_support/core_ext/range/each.rb
activesupport-5.1.6.2 lib/active_support/core_ext/range/each.rb
activesupport-5.0.7.2 lib/active_support/core_ext/range/each.rb
activesupport-5.1.6.1 lib/active_support/core_ext/range/each.rb
activesupport-5.0.7.1 lib/active_support/core_ext/range/each.rb
activesupport-5.1.6 lib/active_support/core_ext/range/each.rb
activesupport-5.0.7 lib/active_support/core_ext/range/each.rb
tdiary-5.0.8 vendor/bundle/gems/activesupport-5.1.5/lib/active_support/core_ext/range/each.rb
activesupport-5.1.5 lib/active_support/core_ext/range/each.rb
activesupport-5.1.5.rc1 lib/active_support/core_ext/range/each.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/core_ext/range/each.rb
activesupport-5.1.4 lib/active_support/core_ext/range/each.rb
activesupport-5.0.6 lib/active_support/core_ext/range/each.rb
activesupport-5.1.4.rc1 lib/active_support/core_ext/range/each.rb
activesupport-5.0.6.rc1 lib/active_support/core_ext/range/each.rb
activesupport-5.1.3 lib/active_support/core_ext/range/each.rb
activesupport-5.1.3.rc3 lib/active_support/core_ext/range/each.rb
activesupport-5.0.5 lib/active_support/core_ext/range/each.rb