Method: Ruby2CExtension::CommonNodeComp#comp_array

Defined in:
lib/ruby2cext/common_node_comp.rb

#comp_array(arr) ⇒ Object



1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
# File 'lib/ruby2cext/common_node_comp.rb', line 1133

def comp_array(arr)
	c_scope_res {
		l "VALUE ary = rb_ary_new2(#{arr.size});"
		arr.each_with_index { |n, i|
			l "RARRAY(ary)->ptr[#{i}] = #{comp(n)};"
			l "RARRAY(ary)->len = #{i+1};"
		}
		"ary"
	}
end