Sha256: 77e71ebe46e2a65032b5ae35ecd0ff115a51274c3ca71e2b15a1c4294191a775

Contents?: true

Size: 412 Bytes

Versions: 20

Compression:

Stored size: 412 Bytes

Contents

module GirFFI
  # Generates method stubs that will replace themselves with the real
  # method upon being called.
  class MethodStubber
    def initialize method_info
      @info = method_info
    end

    def method_stub
      symbol = @info.name
      "
        def #{@info.method? ? '' : 'self.'}#{symbol} *args, &block
          setup_and_call :#{symbol}, *args, &block
        end
      "
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
gir_ffi-0.7.0 lib/gir_ffi/method_stubber.rb
gir_ffi-0.6.7 lib/gir_ffi/method_stubber.rb
gir_ffi-0.6.6 lib/gir_ffi/method_stubber.rb
gir_ffi-0.6.5 lib/gir_ffi/method_stubber.rb
gir_ffi-0.6.4 lib/gir_ffi/method_stubber.rb
gir_ffi-0.6.3 lib/gir_ffi/method_stubber.rb
gir_ffi-0.6.2 lib/gir_ffi/method_stubber.rb
gir_ffi-0.6.1 lib/gir_ffi/method_stubber.rb
gir_ffi-0.6.0 lib/gir_ffi/method_stubber.rb
gir_ffi-0.5.2 lib/gir_ffi/method_stubber.rb
gir_ffi-0.5.1 lib/gir_ffi/method_stubber.rb
gir_ffi-0.5.0 lib/gir_ffi/method_stubber.rb
gir_ffi-0.4.3 lib/gir_ffi/method_stubber.rb
gir_ffi-0.4.2 lib/gir_ffi/method_stubber.rb
gir_ffi-0.4.1 lib/gir_ffi/method_stubber.rb
gir_ffi-0.4.0 lib/gir_ffi/method_stubber.rb
gir_ffi-0.3.2 lib/gir_ffi/method_stubber.rb
gir_ffi-0.3.1 lib/gir_ffi/method_stubber.rb
gir_ffi-0.3.0 lib/gir_ffi/method_stubber.rb
gir_ffi-0.2.3 lib/gir_ffi/method_stubber.rb