123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::EachTimeWithZone

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Prepended In:
Defined in: activesupport/lib/active_support/core_ext/range/each.rb

Instance Method Summary

Instance Method Details

#each(&block)

[ GitHub ]

  
# File 'activesupport/lib/active_support/core_ext/range/each.rb', line 7

def each(&block)
  ensure_iteration_allowed
  super
end

#ensure_iteration_allowed (private)

Raises:

  • (TypeError)
[ GitHub ]

  
# File 'activesupport/lib/active_support/core_ext/range/each.rb', line 18

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

#step(n = 1, &block)

[ GitHub ]

  
# File 'activesupport/lib/active_support/core_ext/range/each.rb', line 12

def step(n = 1, &block)
  ensure_iteration_allowed
  super
end