Class: GirFFI::Builders::BaseMethodBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gir_ffi/builders/base_method_builder.rb

Overview

Base class for method definition builders.

Instance Method Summary collapse

Constructor Details

#initialize(info, return_value_builder_class, receiver_info: nil, argument_builder_class: ArgumentBuilder) ⇒ BaseMethodBuilder

Returns a new instance of BaseMethodBuilder.



15
16
17
18
19
20
21
22
# File 'lib/gir_ffi/builders/base_method_builder.rb', line 15

def initialize(info, return_value_builder_class,
               receiver_info: nil,
               argument_builder_class: ArgumentBuilder)
  @info = info
  @return_value_builder_class = return_value_builder_class
  @argument_builder_class = argument_builder_class
  @receiver_info = receiver_info
end

Instance Method Details

#invocationObject

Methods used by MethodTemplate



30
31
32
# File 'lib/gir_ffi/builders/base_method_builder.rb', line 30

def invocation
  "#{lib_name}.#{@info.symbol} #{function_call_arguments.join(", ")}".strip
end

#method_argumentsObject



34
35
36
# File 'lib/gir_ffi/builders/base_method_builder.rb', line 34

def method_arguments
  argument_builder_collection.method_argument_names
end

#method_definitionObject



24
25
26
# File 'lib/gir_ffi/builders/base_method_builder.rb', line 24

def method_definition
  template.method_definition
end

#preparationObject



38
39
40
# File 'lib/gir_ffi/builders/base_method_builder.rb', line 38

def preparation
  []
end