Sha256: a76bddb154310fcd5f448a9e8a41f51244c8aaca608899ca334045aed9c35bb5

Contents?: true

Size: 373 Bytes

Versions: 9

Compression:

Stored size: 373 Bytes

Contents

# frozen_string_literal: true
module GirFFI
  module InfoExt
    # Extension module provinding a #safe_name method suitable for functions.
    module SafeFunctionName
      def safe_name
        name = self.name
        return '_' if name.empty?
        name
      end
    end
  end
end

GObjectIntrospection::IFunctionInfo.send :include, GirFFI::InfoExt::SafeFunctionName

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.11.1 lib/gir_ffi/info_ext/safe_function_name.rb
gir_ffi-0.11.0 lib/gir_ffi/info_ext/safe_function_name.rb
gir_ffi-0.10.2 lib/gir_ffi/info_ext/safe_function_name.rb
gir_ffi-0.10.1 lib/gir_ffi/info_ext/safe_function_name.rb
gir_ffi-0.10.0 lib/gir_ffi/info_ext/safe_function_name.rb
gir_ffi-0.10.0.pre1 lib/gir_ffi/info_ext/safe_function_name.rb
gir_ffi-0.9.5 lib/gir_ffi/info_ext/safe_function_name.rb
gir_ffi-0.9.4 lib/gir_ffi/info_ext/safe_function_name.rb
gir_ffi-0.9.3 lib/gir_ffi/info_ext/safe_function_name.rb