Class: FFIGen::ArrayType
- Defined in:
- lib/ffi_gen.rb,
lib/ffi_gen/java_output.rb,
lib/ffi_gen/ruby_output.rb
Instance Method Summary collapse
-
#initialize(element_type, constant_size) ⇒ ArrayType
constructor
A new instance of ArrayType.
- #java_description ⇒ Object
- #java_jna_type ⇒ Object
- #java_name ⇒ Object
- #name ⇒ Object
- #ruby_description ⇒ Object
- #ruby_ffi_type ⇒ Object
- #ruby_name ⇒ Object
Constructor Details
#initialize(element_type, constant_size) ⇒ ArrayType
Returns a new instance of ArrayType.
246 247 248 249 |
# File 'lib/ffi_gen.rb', line 246 def initialize(element_type, constant_size) @element_type = element_type @constant_size = constant_size end |
Instance Method Details
#java_description ⇒ Object
266 267 268 |
# File 'lib/ffi_gen/java_output.rb', line 266 def java_description "Array of #{@element_type.java_description}" end |
#java_jna_type ⇒ Object
258 259 260 261 262 263 264 |
# File 'lib/ffi_gen/java_output.rb', line 258 def java_jna_type if @constant_size raise else "#{@element_type.java_jna_type}[]" end end |
#java_name ⇒ Object
254 255 256 |
# File 'lib/ffi_gen/java_output.rb', line 254 def java_name "array" end |
#ruby_description ⇒ Object
287 288 289 |
# File 'lib/ffi_gen/ruby_output.rb', line 287 def ruby_description "Array<#{@element_type.ruby_description}>" end |
#ruby_ffi_type ⇒ Object
279 280 281 282 283 284 285 |
# File 'lib/ffi_gen/ruby_output.rb', line 279 def ruby_ffi_type if @constant_size "[#{@element_type.ruby_ffi_type}, #{@constant_size}]" else ":pointer" end end |
#ruby_name ⇒ Object
275 276 277 |
# File 'lib/ffi_gen/ruby_output.rb', line 275 def ruby_name "array" end |