Class: GirFFI::Builders::InitializerBuilder

Inherits:
BaseMethodBuilder show all
Defined in:
lib/gir_ffi/builders/initializer_builder.rb

Overview

Implements the creation of a Ruby object initializer definition out of a GIR IFunctionInfo.

Instance Method Summary collapse

Methods inherited from BaseMethodBuilder

#argument_builder_collection, #argument_builders, #error_argument, #invocation, #method_arguments, #method_definition, #preparation, #receiver_builder, #return_value_builder, #return_value_info, #template, #variable_generator

Constructor Details

#initialize(info) ⇒ InitializerBuilder

Returns a new instance of InitializerBuilder.



10
11
12
# File 'lib/gir_ffi/builders/initializer_builder.rb', line 10

def initialize(info)
  super(info, InitializerReturnValueBuilder)
end

Instance Method Details

#function_call_argumentsObject



26
27
28
# File 'lib/gir_ffi/builders/initializer_builder.rb', line 26

def function_call_arguments
  argument_builder_collection.call_argument_names
end

#method_nameObject



18
19
20
# File 'lib/gir_ffi/builders/initializer_builder.rb', line 18

def method_name
  @info.safe_name.sub(/^new/, 'initialize')
end

#resultObject



22
23
24
# File 'lib/gir_ffi/builders/initializer_builder.rb', line 22

def result
  []
end

#singleton_method?Boolean

Returns:



14
15
16
# File 'lib/gir_ffi/builders/initializer_builder.rb', line 14

def singleton_method?
  false
end