graphgem 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graph.rb +5 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0577065307d342acdc8a4f20d2512bda58f713b
4
- data.tar.gz: 1d7cef0581768bd4083bfb735c9f8024be4930aa
3
+ metadata.gz: 24f9d8040af2b947df326f91df55c7ffd6c57dd6
4
+ data.tar.gz: 9f35f2666e1ff6017b575692860e021fe2078c87
5
5
  SHA512:
6
- metadata.gz: 49f7217242f5435a5f20d6c6afa53c36187a0d143d50d06a0b31e0d53b961249465dc7442361b722acc1fae8dfc22054902ebd1912e4f508a206526032c7070a
7
- data.tar.gz: 287b432471392b775c15c7e26b996e8d792fb36302b5a17ce204232c71eaf02a7fd40478c669693286bbfa42da8642097fa47134c03227e18295214b7c3e476d
6
+ metadata.gz: 8423bc3956b1e7e24fabcd4826787b481f3ffd0cb9009d2d06a7ac810eb16608a37cafb0fe1ad135fef7a0308e9fda972c8fee0969558d7da4d5c5fcb17b8a55
7
+ data.tar.gz: b0591b6bf911da20be338b4c8ba5cf4e43347ce4d1371ea47077a38b5be226a95280eb39b25a8ca28476e6f7de1e9fc225f892ad92c37be9ab9c86604c625254
data/lib/graph.rb CHANGED
@@ -39,6 +39,11 @@ class Graph
39
39
  return getNode(from).getConnection(to).weight
40
40
  end
41
41
 
42
+ def modifyWeight from, to, newWeight
43
+ return nil if !isNode?(from) || !isNode?(to)
44
+ getNode(from).getConnection(to).weight = newWeight
45
+ end
46
+
42
47
  def isConnected? from, to
43
48
  return nil if !isNode?(from) || !isNode?(to)
44
49
  return getNode(from).connectedTo?(to)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Huelsman