mirror of https://github.com/koreader/koreader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
274 B
Lua
18 lines
274 B
Lua
1 year ago
|
local ResourceIterator = {
|
||
|
|
||
|
}
|
||
|
|
||
|
function ResourceIterator:new(webpage)
|
||
|
local i = 0
|
||
|
local item_count = #webpage.items
|
||
|
return function()
|
||
|
i = i + 1
|
||
|
if i <= item_count
|
||
|
then
|
||
|
return webpage.items[i]
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return ResourceIterator
|