Class: GirFFI::UserDefinedPropertyInfo

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

Overview

Represents a property of a user defined type. Wraps a GParamSpec with useful helper methods for building property accessors etc.

Defined Under Namespace

Classes: UserDefinedTypeInfo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(param_spec, container, offset) ⇒ UserDefinedPropertyInfo

Returns a new instance of UserDefinedPropertyInfo.



105
106
107
108
109
# File 'lib/gir_ffi/user_defined_property_info.rb', line 105

def initialize(param_spec, container, offset)
  @param_spec = param_spec
  @container = container
  @offset = offset
end

Instance Attribute Details

#containerObject (readonly)

Returns the value of attribute container.



111
112
113
# File 'lib/gir_ffi/user_defined_property_info.rb', line 111

def container
  @container
end

#offsetObject (readonly)

Returns the value of attribute offset.



111
112
113
# File 'lib/gir_ffi/user_defined_property_info.rb', line 111

def offset
  @offset
end

#param_specObject (readonly)

Returns the value of attribute param_spec.



111
112
113
# File 'lib/gir_ffi/user_defined_property_info.rb', line 111

def param_spec
  @param_spec
end

Instance Method Details

#ffi_typeObject



129
130
131
# File 'lib/gir_ffi/user_defined_property_info.rb', line 129

def ffi_type
  field_type.ffi_type
end

#field_symbolObject



133
134
135
# File 'lib/gir_ffi/user_defined_property_info.rb', line 133

def field_symbol
  name.to_sym
end

#field_typeObject



117
118
119
# File 'lib/gir_ffi/user_defined_property_info.rb', line 117

def field_type
  @field_type ||= UserDefinedTypeInfo.new @param_spec
end

#nameObject



113
114
115
# File 'lib/gir_ffi/user_defined_property_info.rb', line 113

def name
  @param_spec.accessor_name
end


121
122
123
# File 'lib/gir_ffi/user_defined_property_info.rb', line 121

def related_array_length_field
  nil
end

#writable?Boolean

Returns:



125
126
127
# File 'lib/gir_ffi/user_defined_property_info.rb', line 125

def writable?
  param_spec.flags[:writable]
end