summaryrefslogtreecommitdiffstats
path: root/third_party/rust/uniffi_bindgen/src/bindings/ruby/templates/TopLevelFunctionTemplate.rb
blob: b6dce0effab4062dbabdc574bf49c797ae48cac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{%- match func.return_type() -%}
{%- when Some with (return_type) %}

def self.{{ func.name()|fn_name_rb }}({%- call rb::arg_list_decl(func) -%})
  {%- call rb::setup_args(func) %}
  result = {% call rb::to_ffi_call(func) %}
  return {{ "result"|lift_rb(return_type) }}
end

{% when None %}

def self.{{ func.name()|fn_name_rb }}({%- call rb::arg_list_decl(func) -%})
  {%- call rb::setup_args(func) %}
  {% call rb::to_ffi_call(func) %}
end
{% endmatch %}