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 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 |
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
# 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 |