Sha256: 983eecc246428ae19bd208f0e9fbf74771a5d27b03c5b6e23b5cbea9cfac8fcf

Contents?: true

Size: 703 Bytes

Versions: 2

Compression:

Stored size: 703 Bytes

Contents

# frozen_string_literal: true
module GirFFI
  # Base module for modules representing GLib namespaces.
  module ModuleBase
    def method_missing(method, *arguments, &block)
      result = setup_method method.to_s
      return super unless result
      send method, *arguments, &block
    end

    def respond_to_missing?(method, *)
      gir_ffi_builder.method_available? method
    end

    def const_missing(classname)
      load_class(classname)
    end

    def load_class(classname)
      gir_ffi_builder.build_namespaced_class classname.to_s
    end

    def gir_ffi_builder
      self::GIR_FFI_BUILDER
    end

    def setup_method(name)
      gir_ffi_builder.setup_method name
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gir_ffi-0.11.1 lib/gir_ffi/module_base.rb
gir_ffi-0.11.0 lib/gir_ffi/module_base.rb