Skip to content

Instantly share code, notes, and snippets.

@Loschcode
Created April 25, 2022 20:44
Show Gist options
  • Save Loschcode/52f9d42ad3ede54625d839b527cfcbcd to your computer and use it in GitHub Desktop.
Save Loschcode/52f9d42ad3ede54625d839b527cfcbcd to your computer and use it in GitHub Desktop.
class Cycles
attr_reader :current, :max
def initialize(current: 1, max: 1)
@current = current
@max = max
end
def next
@current += 1
end
def max?
current >= max
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment