Class: GirFFI::Builders::PropertyGetterBuilder
- Inherits:
-
Object
- Object
- GirFFI::Builders::PropertyGetterBuilder
- Defined in:
- lib/gir_ffi/builders/property_builder.rb
Overview
Method builder used for the creation of property getter methods.
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#return_value_builder ⇒ Object
readonly
Returns the value of attribute return_value_builder.
Instance Method Summary collapse
-
#initialize(info, return_value_builder) ⇒ PropertyGetterBuilder
constructor
A new instance of PropertyGetterBuilder.
- #invocation ⇒ Object
- #method_arguments ⇒ Object
- #method_definition ⇒ Object
- #method_name ⇒ Object
- #preparation ⇒ Object
- #result ⇒ Object
- #singleton_method? ⇒ Boolean
- #template ⇒ Object
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
#info ⇒ Object (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_builder ⇒ Object (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
#invocation ⇒ Object
45 46 47 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 45 def invocation "get_property('#{info.name}')" end |
#method_arguments ⇒ Object
37 38 39 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 37 def method_arguments [] end |
#method_definition ⇒ Object
21 22 23 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 21 def method_definition template.method_definition end |
#method_name ⇒ Object
33 34 35 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 33 def method_name info.getter_name end |
#preparation ⇒ Object
41 42 43 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 41 def preparation [] end |
#result ⇒ Object
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
29 30 31 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 29 def singleton_method? false end |
#template ⇒ Object
25 26 27 |
# File 'lib/gir_ffi/builders/property_builder.rb', line 25 def template @template ||= MethodTemplate.new(self, argument_builder_collection) end |