Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # old_revision [12fa61104a25ac778049b18a600d787bee258d05]
- #
- # patch "lib/chordrails/finders.rb"
- # from [56fb10922fa42b22c3cccf93fba707012b10b397]
- # to [15cabc7ebfcbf1aa68cc37b215041fdb39d26e64]
- #
- ============================================================
- --- lib/chordrails/finders.rb 56fb10922fa42b22c3cccf93fba707012b10b397
- +++ lib/chordrails/finders.rb 15cabc7ebfcbf1aa68cc37b215041fdb39d26e64
- @@ -31,15 +31,19 @@ module Chordrails
- module NestedIterator
- class Iterator
- - def initialize(entryIterator)
- + def initialize(entryIterator, start)
- @entryIterator = entryIterator
- - @subIterator = nil
- + if start
- + @subIterator = Chordraisl::Anonymous.new(@entryIterator.next(dh).value).iterator(start)
- + else
- + @subIterator = nil
- + end
- end
- def next(dh)
- @subIterator.next(dh)
- end
- def current(*args)
- - nil
- + "#{@entryIterator.current}_#{@subIterator.current}"
- end
- def hasNext(dh)
- if @subIterator.nil?
- @@ -67,13 +71,17 @@ module Chordrails
- end
- sum
- end
- - def iterator
- - Iterator.new(entryIterator)
- + def iterator(start = nil)
- + outer = nil
- + inner = nil
- + if start
- + outer, inner = start.split("_")
- + end
- + Iterator.new(entryIterator(outer), inner)
- end
- end
Add Comment
Please, Sign In to add comment