Sha256: 6edba6412ff6521a9e8315ee8fb5f8c0d83927bde4c948415c7a84d04b8dc7c3

Contents?: true

Size: 236 Bytes

Versions: 8

Compression:

Stored size: 236 Bytes

Contents

class Node
  attr_accessor :neighbours

  def initialize(arg)
    @args = arg
    @neighbours = []
  end

  def degree
    @neighbours.size
  end

  def method_missing(name, *args)
    super unless args.empty?
    @args[name]
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rgraph-0.0.13 lib/rgraph/node.rb
rgraph-0.0.12 lib/rgraph/node.rb
rgraph-0.0.11 lib/rgraph/node.rb
rgraph-0.0.10 lib/rgraph/node.rb
rgraph-0.0.9 lib/rgraph/node.rb
rgraph-0.0.8 lib/rgraph/node.rb
rgraph-0.0.6 lib/rgraph/node.rb
rgraph-0.0.5 lib/rgraph/node.rb