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

#invocation, #method_arguments, #method_definition, #preparation

Constructor Details

#initialize(info) ⇒ InitializerBuilder

Returns a new instance of InitializerBuilder.



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

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

Instance Method Details

#function_call_argumentsObject



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

def function_call_arguments
  argument_builder_collection.call_argument_names
end

#method_nameObject



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

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

#resultObject



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

def result
  []
end

#singleton_method?Boolean

Returns:



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

def singleton_method?
  false
end