Class: Yt::Models::Iterator
- Inherits:
-
Enumerator
- Object
- Enumerator
- Yt::Models::Iterator
- Defined in:
- lib/yt/models/iterator.rb
Overview
If we dropped support for Ruby 1.9.3, then we could simply use Enumerator which takes a ‘size` parameter in Ruby >= 2.
Instance Method Summary collapse
-
#initialize(size = nil, &block) ⇒ Iterator
constructor
A new instance of Iterator.
- #size ⇒ Object
Constructor Details
#initialize(size = nil, &block) ⇒ Iterator
Returns a new instance of Iterator.
6 7 8 |
# File 'lib/yt/models/iterator.rb', line 6 def initialize(size=nil, &block) RUBY_VERSION < '2' ? super(&block) : super(size, &block) end |
Instance Method Details
#size ⇒ Object
10 11 12 |
# File 'lib/yt/models/iterator.rb', line 10 def size RUBY_VERSION < '2' ? count : super end |