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.0.7 lib/active_support/core_ext/range/each.rb
activesupport-4.0.6 lib/active_support/core_ext/range/each.rb
activesupport-4.1.2 lib/active_support/core_ext/range/each.rb
activesupport-4.1.2.rc3 lib/active_support/core_ext/range/each.rb
activesupport-4.0.6.rc3 lib/active_support/core_ext/range/each.rb
whos_dated_who-0.1.0 vendor/bundle/gems/activesupport-4.1.1/lib/active_support/core_ext/range/each.rb
activesupport-4.1.2.rc2 lib/active_support/core_ext/range/each.rb
activesupport-4.0.6.rc2 lib/active_support/core_ext/range/each.rb
whos_dated_who-0.0.1 vendor/bundle/gems/activesupport-4.1.1/lib/active_support/core_ext/range/each.rb
activesupport-4.1.2.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.0.6.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.0.5 lib/active_support/core_ext/range/each.rb
activesupport-4.1.1 lib/active_support/core_ext/range/each.rb
activesupport-4.1.0 lib/active_support/core_ext/range/each.rb
activesupport-4.1.0.rc2 lib/active_support/core_ext/range/each.rb
activesupport-4.0.4 lib/active_support/core_ext/range/each.rb
activesupport-4.0.4.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.1.0.rc1 lib/active_support/core_ext/range/each.rb