Class: GirFFI::ArrayElementConvertor
- Inherits:
-
Object
- Object
- GirFFI::ArrayElementConvertor
- Defined in:
- lib/gir_ffi/array_element_convertor.rb
Overview
The ArrayElementConvertor class handles conversion from C array elements to ruby values
Instance Attribute Summary collapse
-
#pointer ⇒ Object
readonly
Returns the value of attribute pointer.
-
#value_type ⇒ Object
readonly
Returns the value of attribute value_type.
Instance Method Summary collapse
-
#initialize(type, ptr) ⇒ ArrayElementConvertor
constructor
A new instance of ArrayElementConvertor.
- #to_ruby_value ⇒ Object
Constructor Details
#initialize(type, ptr) ⇒ ArrayElementConvertor
Returns a new instance of ArrayElementConvertor.
9 10 11 12 |
# File 'lib/gir_ffi/array_element_convertor.rb', line 9 def initialize(type, ptr) @value_type = type @pointer = ptr end |
Instance Attribute Details
#pointer ⇒ Object (readonly)
Returns the value of attribute pointer.
7 8 9 |
# File 'lib/gir_ffi/array_element_convertor.rb', line 7 def pointer @pointer end |
#value_type ⇒ Object (readonly)
Returns the value of attribute value_type.
7 8 9 |
# File 'lib/gir_ffi/array_element_convertor.rb', line 7 def value_type @value_type end |
Instance Method Details
#to_ruby_value ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gir_ffi/array_element_convertor.rb', line 14 def to_ruby_value = to_value case value_type when :utf8, :filename .to_utf8 when Array value_type[1].wrap when Module value_type.wrap else end end |