Class: GirFFI::Builders::PropertyBuilder
- Inherits:
-
Object
- Object
- GirFFI::Builders::PropertyBuilder
- Defined in:
- lib/gir_ffi/builders/property_builder.rb
Overview
Creates property getter and setter code for a given IPropertyInfo.
Instance Method Summary collapse
- #build ⇒ Object
- #container_defines_getter_method? ⇒ Boolean
- #getter_def ⇒ Object
-
#initialize(property_info) ⇒ PropertyBuilder
constructor
A new instance of PropertyBuilder.
- #setter_def ⇒ Object
- #setup_getter ⇒ Object
- #setup_setter ⇒ Object
Constructor Details
#initialize(property_info) ⇒ PropertyBuilder
Returns a new instance of PropertyBuilder.
63 64 65 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 63 def initialize(property_info) @info = property_info end |
Instance Method Details
#build ⇒ Object
67 68 69 70 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 67 def build setup_getter setup_setter if setting_allowed end |
#container_defines_getter_method? ⇒ Boolean
78 79 80 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 78 def container_defines_getter_method? container_info.find_instance_method getter_name end |
#getter_def ⇒ Object
86 87 88 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 86 def getter_def PropertyGetterBuilder.new(@info, getter_builder).method_definition end |
#setter_def ⇒ Object
90 91 92 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 90 def setter_def converting_setter_def end |
#setup_getter ⇒ Object
72 73 74 75 76 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 72 def setup_getter return if container_defines_getter_method? container_class.class_eval getter_def, __FILE__, __LINE__ end |
#setup_setter ⇒ Object
82 83 84 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 82 def setup_setter container_class.class_eval setter_def, __FILE__, __LINE__ end |