~ubuntu-branches/ubuntu/utopic/ruby-gir-ffi/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/gir_ffi/builders/with_methods.rb

  • Committer: Package Import Robot
  • Author(s): TANIGUCHI Takaki
  • Date: 2014-06-22 16:13:36 UTC
  • mfrom: (10.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140622161336-zo88bzrlqw71cpyy
Tags: 0.7.4-1
* Imported Upstream version 0.7.4
* Bump Standards-Version to 3.9.5 (with no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
      end
28
28
 
29
29
      def attach_and_define_method method, go, modul
30
 
        return false if go.nil?
 
30
        return unless go
 
31
        method = go.safe_name
31
32
        Builder.attach_ffi_function lib, go
32
 
        modul.class_eval { remove_method method }
 
33
        modul.class_eval { remove_method method if method_defined? method }
33
34
        build_class.class_eval function_definition(go)
34
 
        true
 
35
        return method
35
36
      end
36
37
 
37
38
      def stub_methods
38
39
        info.get_methods.each do |minfo|
39
 
          @klass.class_eval MethodStubber.new(minfo).method_stub
 
40
          klass.class_eval MethodStubber.new(minfo).method_stub
40
41
        end
41
42
      end
42
43
    end