Class: FFI::Generator::Function

Inherits:
Type
  • Object
show all
Defined in:
lib/generator/generator.rb

Defined Under Namespace

Classes: Argument

Instance Attribute Summary

Attributes inherited from Node

#symname

Instance Method Summary collapse

Methods inherited from Node

#get_attr

Constructor Details

#initialize(params = { }) ⇒ Function

Returns a new instance of Function.



243
244
245
246
# File 'lib/generator/generator.rb', line 243

def initialize(params = { })
  super
  @type = get_attr('type')
end

Instance Method Details

#to_sObject



247
248
249
250
251
252
# File 'lib/generator/generator.rb', line 247

def to_s
  params = get_params(@node).inject([]) do |array, node|
    array << Argument.new(:node => node).to_s
  end.collect { |p| "#{p}" }
  @indent_str + "attach_function :#{@symname}, [ #{params.join(', ')} ], #{get_rvalue}"
end