public static void toAryValue(Graph graph, ToAryVertex vertex) {
vertex.addTypes(arrayValue(graph, vertex.getValueVertex()));
}
public static TypeSet arrayValue(Graph graph, Vertex vertex) {
Ruby runtime = graph.getRuntime();
TypeSet typeSet = new TypeSet();
for (IRubyObject object : vertex.getTypeSet()) {
if (object.isKindOf(runtime.getArray())) {
typeSet.add(object);
} else {
CallVertex callVertex = new CallVertex(vertex.getNode(), "to_a", vertex, null, null);
for (IRubyObject array : call(graph, callVertex).getTypeSet()) {
if (array.isKindOf(runtime.getArray())) {
typeSet.add(array);
} else {
Logger.warn("to_a should be return Array");
}
}