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.
262 263 264 265 |
# File 'lib/ffi_gen.rb', line 262 def initialize(element_type, constant_size) @element_type = element_type @constant_size = constant_size end |
Instance Method Details
#java_description ⇒ Object
377 378 379 |
# File 'lib/ffi_gen/java_output.rb', line 377 def java_description "Array of #{@element_type.java_description}" end |
#java_jna_type ⇒ Object
369 370 371 372 373 374 375 |
# File 'lib/ffi_gen/java_output.rb', line 369 def java_jna_type if @constant_size "#{@element_type.java_jna_type}[#{@constant_size}]" else "#{@element_type.java_jna_type}[]" end end |
#java_name ⇒ Object
365 366 367 |
# File 'lib/ffi_gen/java_output.rb', line 365 def java_name "array" end |
#ruby_description ⇒ Object
304 305 306 |
# File 'lib/ffi_gen/ruby_output.rb', line 304 def ruby_description "Array<#{@element_type.ruby_description}>" end |
#ruby_ffi_type ⇒ Object
296 297 298 299 300 301 302 |
# File 'lib/ffi_gen/ruby_output.rb', line 296 def ruby_ffi_type if @constant_size "[#{@element_type.ruby_ffi_type}, #{@constant_size}]" else ":pointer" end end |
#ruby_name ⇒ Object
292 293 294 |
# File 'lib/ffi_gen/ruby_output.rb', line 292 def ruby_name "array" end |