Skip to content

Instantly share code, notes, and snippets.

View Ross-Hunter's full-sized avatar

Ross-Hunter Ross-Hunter

View GitHub Profile
## Contrived Example
# Will the thing float?
class Thing
attr_accessor :mass, :volume
def will_i_float?
(mass / volume) < 1
end
"appOptions": {
"appStoreUrl":"https://itunes.apple.com/us/app/app_name/idXXX",
"iosUrlScheme":"app_name://launchedfromthisappwiththeseoptions",
"androidAppID":"com.XXX.app_name",
"appName":"App Name"
}
gotoExternalApp = function () {
var options = Environment.appOptions;
console.log ("Launching " + options.appName);
ExternalApp.launch(options);
};
gotoExternalApp();
#
# The goal of this exercise is work on identifying abstraction which helps simplify, document,
# and separate the concerns going on in file.
#
# Exercise:
# * Find related ideas in the below code
# * Abstract them out (methods, modules, classes, etc, you pick!)
# * If you find multiple ways, then do a separate gist for each way.
# * Rinse repeat until you see no other ways.
#