class GraphElements::Vertex

Define abstract methods to Vertex

Attributes

attributes[RW]

The attributes of vertex

edges[RW]

The attributes of vertex

id[RW]

The attributes of vertex

type[RW]

The attributes of vertex

Public Class Methods

new(id, type, attributes) click to toggle source

Constructor to vertex

Params:
id

Integer vertex id

type

Class of vertex

attributes

Hash aditional attributes of vertex

Returns NotImplementedError

# File lib/social_framework/graphs/graph_elements.rb, line 15
def initialize id, type, attributes
  raise 'Must implement method in subclass'
end

Public Instance Methods

==(other) click to toggle source

Overriding equal method Returns NotImplementedError

# File lib/social_framework/graphs/graph_elements.rb, line 21
def ==(other)
  raise 'Must implement method in subclass'
end
Also aliased as: eql?
add_edge(destiny, label = "") click to toggle source

Method to add edges to vertex

Params:
destiny

Vertex destiny to edge

label

String label to edge

Returns NotImplementedError

# File lib/social_framework/graphs/graph_elements.rb, line 38
def add_edge destiny, label = ""
  raise 'Must implement method in subclass'
end
eql?(other)
Alias for: ==
hash() click to toggle source

Overriding hash method Returns NotImplementedError

# File lib/social_framework/graphs/graph_elements.rb, line 29
def hash
  raise 'Must implement method in subclass'
end