Debian Codegraph @

third_party/rust/uniffi_bindgen/src/bindings/ruby/templates/TopLevelFunctionTemplate.rb

raw
1 {%- match func.return_type() -%}
2 {%- when Some with (return_type) %}
3
4 def self.{{ func.name()|fn_name_rb }}({%- call rb::arg_list_decl(func) -%})
5 {%- call rb::setup_args(func) %}
6 result = {% call rb::to_ffi_call(func) %}
7 return {{ "result"|lift_rb(return_type) }}
8 end
9
10 {% when None %}
11
12 def self.{{ func.name()|fn_name_rb }}({%- call rb::arg_list_decl(func) -%})
13 {%- call rb::setup_args(func) %}
14 {% call rb::to_ffi_call(func) %}
15 end
16 {% endmatch %}