Sha256: f7f358b11abf62f5f96bfcd909be62f87d414c606872e9413e4a48aeee509b2f

Contents?: true

Size: 487 Bytes

Versions: 84

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

require "active_support/time_with_zone"

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?(TimeWithZone)
      end
  end
end

Range.prepend(ActiveSupport::EachTimeWithZone)

Version data entries

84 entries across 80 versions & 11 rubygems

Version Path
activesupport-7.2.1 lib/active_support/core_ext/range/each.rb
activesupport-7.2.0 lib/active_support/core_ext/range/each.rb
activesupport-7.2.0.rc1 lib/active_support/core_ext/range/each.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/range/each.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.4/lib/active_support/core_ext/range/each.rb
activesupport-7.2.0.beta3 lib/active_support/core_ext/range/each.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/range/each.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/range/each.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.5.1/lib/active_support/core_ext/range/each.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/range/each.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/core_ext/range/each.rb
activesupport-7.2.0.beta2 lib/active_support/core_ext/range/each.rb
activesupport-7.1.3.4 lib/active_support/core_ext/range/each.rb
activesupport-7.0.8.4 lib/active_support/core_ext/range/each.rb
activesupport-7.2.0.beta1 lib/active_support/core_ext/range/each.rb
activesupport-7.1.3.2 lib/active_support/core_ext/range/each.rb
activesupport-7.1.3.1 lib/active_support/core_ext/range/each.rb
activesupport-7.0.8.1 lib/active_support/core_ext/range/each.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.3/lib/active_support/core_ext/range/each.rb
activesupport-7.1.3 lib/active_support/core_ext/range/each.rb