diff options
| author | realtradam <[email protected]> | 2022-03-06 22:06:07 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-03-06 22:06:07 -0500 |
| commit | a96db26c3ca488ddb4093a5432399b4578a49bb7 (patch) | |
| tree | 8949514c6fd2deb2333b36c722d6446e731bdb53 /templates.rb | |
| parent | a46b7913f413cc083cc73d67442d70339132cd7b (diff) | |
| download | FelBind-a96db26c3ca488ddb4093a5432399b4578a49bb7.tar.gz FelBind-a96db26c3ca488ddb4093a5432399b4578a49bb7.zip | |
complete working phase 3, some refactoring
Diffstat (limited to 'templates.rb')
| -rw-r--r-- | templates.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/templates.rb b/templates.rb index a4c0659..2d987a6 100644 --- a/templates.rb +++ b/templates.rb @@ -48,10 +48,10 @@ mrb_get_args(mrb, "|:", &kwargs); } end - def unwrap_kwarg(kwarg_iter, body_if_defined, body_if_undefined) + def unwrap_kwarg(kwarg_iter, body_if_defined, body_if_undefined = nil, no_argument_error_message = 'Missing Keyword Argument') %{ if (mrb_undef_p(kw_values[#{kwarg_iter}])) { -#{body_if_undefined} +#{body_if_undefined || "mrb_load_string(mrb, \"raise ArgumentError.new \\\"#{no_argument_error_message}\\\"\");"} } else { #{body_if_defined} } |
