Created
February 26, 2015 10:21
-
-
Save pinglamb/5e3da719fa5fb7694110 to your computer and use it in GitHub Desktop.
Changelog class for per user changes dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Changelog | |
# Put your available versions in the array, in reverse release order, e.g. %w(1.1 1.0 0.9.9999999) | |
VERSIONS = %w().freeze | |
class << self | |
# e.g. Changelog.after('1.0') | |
def after(version) | |
changes = Changelog.new | |
if index = VERSIONS.index(version) | |
VERSIONS[0...index].collect {|v| changes[v] }.flatten | |
else | |
[] | |
end | |
end | |
end | |
def [](version) | |
@all[version] | |
end | |
def initialize | |
@all = { | |
# '1.0' => [ | |
# 'Something hardcore you want others to know', | |
# ], | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment