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.15 lib/active_support/core_ext/range/each.rb
activesupport-4.2.6 lib/active_support/core_ext/range/each.rb
activesupport-4.1.15.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.2.6.rc1 lib/active_support/core_ext/range/each.rb
activesupport-4.1.14.2 lib/active_support/core_ext/range/each.rb
activesupport-4.2.5.2 lib/active_support/core_ext/range/each.rb
activejob-lock-0.0.2 rails/activesupport/lib/active_support/core_ext/range/each.rb
activesupport-4.2.5.1 lib/active_support/core_ext/range/each.rb
activesupport-4.1.14.1 lib/active_support/core_ext/range/each.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/range/each.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/core_ext/range/each.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/range/each.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/core_ext/range/each.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/core_ext/range/each.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/core_ext/range/each.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/core_ext/range/each.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/activesupport-4.1.13/lib/active_support/core_ext/range/each.rb
activesupport-4.1.14 lib/active_support/core_ext/range/each.rb
activesupport-4.2.5 lib/active_support/core_ext/range/each.rb
activesupport-4.2.5.rc2 lib/active_support/core_ext/range/each.rb