Sha256: c9ce7ca7c0f1628fd395523c0e3c067f560275179170e88f26aa9dbd4b703de7

Contents?: true

Size: 544 Bytes

Versions: 118

Compression:

Stored size: 544 Bytes

Contents

require 'active_support/core_ext/module/aliasing'

class Range #:nodoc:

  def each_with_time_with_zone(&block)
    ensure_iteration_allowed
    each_without_time_with_zone(&block)
  end
  alias_method_chain :each, :time_with_zone

  def step_with_time_with_zone(n = 1, &block)
    ensure_iteration_allowed
    step_without_time_with_zone(n, &block)
  end
  alias_method_chain :step, :time_with_zone

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

Version data entries

118 entries across 113 versions & 12 rubygems

Version Path
activesupport-4.2.11.3 lib/active_support/core_ext/range/each.rb
activesupport-4.2.11.2 lib/active_support/core_ext/range/each.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/activesupport-4.2.11.1/lib/active_support/core_ext/range/each.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/activesupport-4.2.11.1/lib/active_support/core_ext/range/each.rb
activesupport-4.2.11.1 lib/active_support/core_ext/range/each.rb
activesupport-4.2.11 lib/active_support/core_ext/range/each.rb
activesupport-4.2.10 lib/active_support/core_ext/range/each.rb
activesupport-4.2.10.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.2.9 lib/active_support/core_ext/range/each.rb
activesupport-4.2.9.rc2 lib/active_support/core_ext/range/each.rb
activesupport-4.2.9.rc1 lib/active_support/core_ext/range/each.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activesupport-4.2.8/lib/active_support/core_ext/range/each.rb
activesupport-4.2.8 lib/active_support/core_ext/range/each.rb
activesupport-4.2.8.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.2.7.1 lib/active_support/core_ext/range/each.rb
activesupport-4.2.7 lib/active_support/core_ext/range/each.rb
activesupport-4.1.16 lib/active_support/core_ext/range/each.rb
activesupport-4.1.16.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.2.7.rc1 lib/active_support/core_ext/range/each.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/core_ext/range/each.rb