Class: FFI::Generator::Function
- Defined in:
- lib/generator/function.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Argument
Constant Summary
Constants inherited from Type
Type::ArrayRE, Type::ArraySizeRE
Instance Attribute Summary
Attributes inherited from Type
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(params = { }) ⇒ Function
constructor
A new instance of Function.
- #to_s ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(params = { }) ⇒ Function
Returns a new instance of Function.
16 17 18 19 |
# File 'lib/generator/function.rb', line 16 def initialize(params = { }) super @type = get_attr('type') end |
Instance Method Details
#to_s ⇒ Object
20 21 22 23 24 25 |
# File 'lib/generator/function.rb', line 20 def to_s params = get_params(@node).inject([]) do |array, node| array << Argument.new(:node => node, :typedefs => @typedefs).to_s end @indent_str + "attach_function :#{@symname}, [ #{params.join(', ')} ], #{get_rtype}" end |