Last active
February 22, 2016 21:12
-
-
Save jgburet/cc4901799acd0c605f37 to your computer and use it in GitHub Desktop.
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
fakeModule1 do | |
description { | |
"This is a nice description of this fake module" | |
} | |
author { "Jean-Guillaume Buret" } | |
usage { 'Just run it!' } | |
init { SubClassInFakeModule1.new() } | |
loop_block { |selector, instance_of_sub_class_in_fake_module| | |
instance_of_sub_class_in_fake_module.refresh_ui | |
} | |
impl { | |
class SubClassInFakeModule1 | |
def initialize(n = 'world') | |
@name = n | |
end | |
def hello | |
puts 'hello ' + @name | |
end | |
end | |
class SubClassInFakeModule2 | |
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
fakeModule1 do | |
description { | |
"This is a nice description of this fake module" | |
} | |
author { "Jean-Guillaume Buret" } | |
usage { 'Just run it!' } | |
init { MyWonderfulUI.new() } | |
impl { | |
class MyWonderfulUI | |
def initialize() | |
@messages_received = [] | |
end | |
def _loop(selector) | |
end | |
def _callback_read(source_stream, message) | |
@messages_received << message | |
end | |
def _callback_write(source_stream) | |
end | |
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
fakeModule1 do | |
description | |
"This is a nice description of this fake module" | |
author | |
"Jean-Guillaume Buret" | |
usage | |
'Just run it!' | |
instance { | |
MyWonderfulUI.new() | |
} | |
# why not just provide the constant on which we can call .new() | |
impl { | |
class MyWonderfulUI | |
def initialize() | |
@messages_received = [] | |
end | |
def _loop(selector) | |
end | |
def _callback_read(source_stream, message) | |
@messages_received << message | |
end | |
def _callback_write(source_stream) | |
end | |
end | |
class SomeClassUsedByTheMainOne | |
# some code in here | |
end | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment