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.1.8 lib/active_support/core_ext/range/each.rb
activesupport-4.0.12 lib/active_support/core_ext/range/each.rb
activesupport-4.2.0.beta4 lib/active_support/core_ext/range/each.rb
activesupport-4.2.0.beta3 lib/active_support/core_ext/range/each.rb
activesupport-4.1.7 lib/active_support/core_ext/range/each.rb
activesupport-4.0.11 lib/active_support/core_ext/range/each.rb
activesupport-4.2.0.beta2 lib/active_support/core_ext/range/each.rb
nanumfont-rails-0.1 vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/core_ext/range/each.rb
activesupport-4.0.10 lib/active_support/core_ext/range/each.rb
activesupport-4.1.6 lib/active_support/core_ext/range/each.rb
activesupport-4.1.6.rc2 lib/active_support/core_ext/range/each.rb
activesupport-4.0.10.rc2 lib/active_support/core_ext/range/each.rb
activesupport-4.2.0.beta1 lib/active_support/core_ext/range/each.rb
activesupport-4.1.6.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.0.10.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.0.9 lib/active_support/core_ext/range/each.rb
activesupport-4.1.5 lib/active_support/core_ext/range/each.rb
activesupport-4.1.4 lib/active_support/core_ext/range/each.rb
activesupport-4.0.8 lib/active_support/core_ext/range/each.rb
activesupport-4.1.3 lib/active_support/core_ext/range/each.rb