Sha256: 4eb07257db33603050d61e99cfbad7b4316e977ddfc7c26ba830073b3b8befee

Contents?: true

Size: 784 Bytes

Versions: 13

Compression:

Stored size: 784 Bytes

Contents

module GirFFI
  module InfoExt
    # Extension module provinding a #safe_name method suitable for types.
    module SafeConstantName
      def safe_name
        name.tr('-', '_').gsub(/^./) do |char|
          case char
          when '_'
            'Private___'
          else
            char.upcase
          end
        end
      end
    end
  end
end

GObjectIntrospection::ICallbackInfo.send :include, GirFFI::InfoExt::SafeConstantName
GObjectIntrospection::IConstantInfo.send :include, GirFFI::InfoExt::SafeConstantName
GObjectIntrospection::IRegisteredTypeInfo.send :include, GirFFI::InfoExt::SafeConstantName
GObjectIntrospection::ISignalInfo.send :include, GirFFI::InfoExt::SafeConstantName
GObjectIntrospection::IVFuncInfo.send :include, GirFFI::InfoExt::SafeConstantName

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.9.1 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.9.0 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.8.6 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.8.5 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.8.4 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.8.3 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.8.2 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.8.1 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.8.0 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.7.10 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.7.9 lib/gir_ffi/info_ext/safe_constant_name.rb
gir_ffi-0.7.8 lib/gir_ffi/info_ext/safe_constant_name.rb