This file contains 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
require 'minitest/autorun' | |
class UsTaxCode | |
def generate(id) | |
"US-#{id}" | |
end | |
end | |
class BrazilTaxCode | |
def generate(id) |
This file contains 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 Object | |
def when(matcher) | |
if matcher === self then yield(self) else self end | |
end | |
end | |
# I read it like this : if "when" lambda/proc is true execute block, otherwise return self | |
#deeply confused | |
#Proc#=== is equivalent to Proc#call |
This file contains 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
char *lib_name_2; | |
/* Initialize the object; grab native call part of its body. */ | |
NativeCallBody *body = get_nc_body(interp, $1); | |
/* Try to load the library. */ | |
body->lib_name = lib_name; | |
body->lib_handle = dlLoadLibrary(strlen(lib_name) ? lib_name : NULL); | |
if (!body->lib_handle) { |