class RGL::EdgePropertiesMap

Public Class Methods

new(edge_properties_map, directed) click to toggle source
# File lib/rgl/edge_properties_map.rb, line 5
def initialize(edge_properties_map, directed)
  @edge_properties_map = edge_properties_map
  @directed = directed

  check_properties
end

Public Instance Methods

edge_property(u, v) click to toggle source
# File lib/rgl/edge_properties_map.rb, line 12
def edge_property(u, v)
  if @directed
    property = @edge_properties_map[[u, v]]
  else
    property = @edge_properties_map[[u, v]] || @edge_properties_map[[v, u]]
  end

  validate_property(property, u, v)

  property
end