Sha256: d750f65ff83234bedcec1687ba9584fff583076ef6f0cab335a897b54f64e14f

Contents?: true

Size: 578 Bytes

Versions: 10

Compression:

Stored size: 578 Bytes

Contents

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 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

10 entries across 10 versions & 1 rubygems

Version Path
gir_ffi-0.9.2 lib/gir_ffi/module_base.rb
gir_ffi-0.9.1 lib/gir_ffi/module_base.rb
gir_ffi-0.9.0 lib/gir_ffi/module_base.rb
gir_ffi-0.8.6 lib/gir_ffi/module_base.rb
gir_ffi-0.8.5 lib/gir_ffi/module_base.rb
gir_ffi-0.8.4 lib/gir_ffi/module_base.rb
gir_ffi-0.8.3 lib/gir_ffi/module_base.rb
gir_ffi-0.8.2 lib/gir_ffi/module_base.rb
gir_ffi-0.8.1 lib/gir_ffi/module_base.rb
gir_ffi-0.8.0 lib/gir_ffi/module_base.rb