Skip to content

Instantly share code, notes, and snippets.

@webuilder240
Created December 10, 2018 06:15
Show Gist options
  • Save webuilder240/3e3d60b5e27b83ccf50b5db17477d1a5 to your computer and use it in GitHub Desktop.
Save webuilder240/3e3d60b5e27b83ccf50b5db17477d1a5 to your computer and use it in GitHub Desktop.
state
class Hoge
module States
ALL = 'all'.freeze
EVENT = 'event'.freeze
GROUP = 'group'.freeze
end
def fuga
case state
when States::ALL
# all
when States::EVENT
# event
when States::GROUP
# group
else
# else
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment