Skip to content

Instantly share code, notes, and snippets.

@stephenmac7
Last active June 30, 2018 00:34
Show Gist options
  • Save stephenmac7/b23d29f4730d05fcfe75aadcba74aea2 to your computer and use it in GitHub Desktop.
Save stephenmac7/b23d29f4730d05fcfe75aadcba74aea2 to your computer and use it in GitHub Desktop.
ADT
# data Action = Switch String | Reduce | Increase
Action = Class.new(Struct)
Switch = Action.new(:to)
# Singletons
Reduce = Action.new('Reduce').new
Increase = Action.new('Increase').new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment