Method: RGL::Graph#size

Defined in:
lib/rgl/base.rb

#sizeint Also known as: num_vertices

Returns the number of vertices.

Returns:

  • (int)

    the number of vertices



248
249
250
# File 'lib/rgl/base.rb', line 248

def size # Why not in Enumerable?
  inject(0) { |n, v| n + 1 }
end