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.
7 8 9 10 11 12 |
# File 'lib/rgl/edge_properties_map.rb', line 7 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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rgl/edge_properties_map.rb', line 14 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 |