Method: Rubigraph::Vertex#initialize
- Defined in:
- lib/rubigraph.rb
#initialize(id = nil) ⇒ Vertex
Returns a new instance of Vertex.
16 17 18 19 20 21 |
# File 'lib/rubigraph.rb', line 16 def initialize(id = nil) @id = id ? Rubigraph.call('ubigraph.new_vertex_w_id', id) : Rubigraph.call('ubigraph.new_vertex') raise 'Rubigraph::Vertex.initialize: cannot create vertex' if @id == -1 end |