Subject: [ruby-ffi] Re: What is the context parameter when defining a custom type with DataConverter? |
From: Wayne Meissner |
Date: 6/3/12 5:21 PM |
To: ruby-ffi@googlegroups.com |
Looking at an old issue (https://github.com/ffi/ffi/issues/114#issuecomment- ) where a custom Bool type is defined, .to_native and .from_native both accept a second “ctx” parameter. What is this? How should it be used, if at all?1246483 The reason I ask is that I’ve written my own converter for making sure input and output strings are always in UTF-8 encoding, and I’d like to do it properly: https://github.com/Burgestrand/libspotify-ruby/ blob/ 35c32461d757649297e3592b80b493 7e35e3a1f8/lib/spotify/utf8_ string.rb