Class: GirFFI::Builders::PropertyGetterBuilder

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

Overview

Method builder used for the creation of property getter methods.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info, return_value_builder) ⇒ PropertyGetterBuilder

Returns a new instance of PropertyGetterBuilder.



16
17
18
19
# File 'lib/gir_ffi/builders/property_builder.rb', line 16

def initialize(info, return_value_builder)
  @return_value_builder = return_value_builder
  @info = info
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



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

def info
  @info
end

#return_value_builderObject (readonly)

Returns the value of attribute return_value_builder.



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

def return_value_builder
  @return_value_builder
end

Instance Method Details

#invocationObject



45
46
47
# File 'lib/gir_ffi/builders/property_builder.rb', line 45

def invocation
  "get_property('#{info.name}')"
end

#method_argumentsObject



37
38
39
# File 'lib/gir_ffi/builders/property_builder.rb', line 37

def method_arguments
  []
end

#method_definitionObject



21
22
23
# File 'lib/gir_ffi/builders/property_builder.rb', line 21

def method_definition
  template.method_definition
end

#method_nameObject



33
34
35
# File 'lib/gir_ffi/builders/property_builder.rb', line 33

def method_name
  info.getter_name
end

#preparationObject



41
42
43
# File 'lib/gir_ffi/builders/property_builder.rb', line 41

def preparation
  []
end

#resultObject



49
50
51
# File 'lib/gir_ffi/builders/property_builder.rb', line 49

def result
  [return_value_builder.return_value_name]
end

#singleton_method?Boolean

Returns:



29
30
31
# File 'lib/gir_ffi/builders/property_builder.rb', line 29

def singleton_method?
  false
end

#templateObject



25
26
27
# File 'lib/gir_ffi/builders/property_builder.rb', line 25

def template
  @template ||= MethodTemplate.new(self, argument_builder_collection)
end