Class: RGL::EdgePropertiesMap
- Inherits:
-
Object
- Object
- RGL::EdgePropertiesMap
- Defined in:
- lib/rgl/edge_properties_map.rb
Direct Known Subclasses
Instance Method Summary collapse
- #edge_property(u, v) ⇒ Object
-
#initialize(edge_properties_map, directed) ⇒ EdgePropertiesMap
constructor
A new instance of EdgePropertiesMap.
Constructor Details
#initialize(edge_properties_map, directed) ⇒ EdgePropertiesMap
Returns a new instance of EdgePropertiesMap.
5 6 7 8 9 10 |
# 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 |
Instance Method Details
#edge_property(u, v) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# 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 |