Skip to content

Instantly share code, notes, and snippets.

View Papierkorb's full-sized avatar

Stefan Merettig Papierkorb

View GitHub Profile
class Boleite::InputReceiver
def process(event : InputEvent)
execute_all(@actions, event) unless event.claimed?
execute_all(@persistent_actions, event)
end
private def execute_all(actions, event)
actions.each{|act| act.execute(event) if act.interested?(event)}
end
end
@Papierkorb
Papierkorb / test.cr
Last active October 1, 2017 10:25 — forked from Groogy/test.cr
# Papierkorb suggestion
class Foo
include CrystalClear
requires var > 5 # Pushes "var > 5" into SOME_ARRAY
ensures result.query? # Pushes "result.query?" into SOME_ARRAY
contract def foo # Expands to the def, processes SOME_ARRAY, and clears it out for the next method
# Code
end