logicgates 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3a7ea9124cc18b8833c7a07534fd395379d00d4
4
- data.tar.gz: 48142f63c53d123ce4c321e6c00b0719c1bfbbe5
3
+ metadata.gz: c42149d3acf1ea91dae5da4310f4ec129f38c05b
4
+ data.tar.gz: ec8a98da8af2c4abdaf6612a037cee9771d14ff1
5
5
  SHA512:
6
- metadata.gz: 3cc0d00e0c628ff61156b349f9543aa1c0948ec71c749637c579a55cd59c6580603a87e7be898601ff4df715e984f4f762f13d30a04bcd991513b9a64c2a8fc3
7
- data.tar.gz: 604e79308973e9066b1674a2b9c155c0fd23ae887770cec3ec620b4ba481a5834c9027ed27ca481c70bddd838fb1ed88082e5b1e3dff5cdad2e8dfe4495249ce
6
+ metadata.gz: e0aaff8cd9968b547986a71072e02dc944374ec5f747c5ad02d10184194452c590e95f5dc54d7c056c55dcb4216633d2a89f5ed3ae783a553a3526ea91a6ac36
7
+ data.tar.gz: 24f72ad1d0fde5cae5812f7f7eca695950ebb57f26988bf72402a499e495b2ec166b44e6ea245a09519cdfd714bc9e2048de4db22eec80b73be0d2f3884cf8e0
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ Gemfile.lock
5
5
  logicgates-0.0.0.gem
6
6
  logicgates-0.0.1.gem
7
7
  logicgates-0.0.2.gem
8
+ logicgates-0.0.3.gem
@@ -1,3 +1,3 @@
1
1
  module LogicGates
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/logicgates.rb CHANGED
@@ -1,35 +1,35 @@
1
1
  module LogicGates
2
2
 
3
- def my_and(a, b)
3
+ def self.and(a, b)
4
4
  a && b
5
5
  end
6
6
 
7
- def my_or(a, b)
7
+ def self.or(a, b)
8
8
  a || b
9
9
  end
10
10
 
11
- def not(a)
11
+ def self.not(a)
12
12
  !a
13
13
  end
14
14
 
15
- def xor(a, b)
16
- my_and(my_or(a, b), not(my_and(a, b)))
15
+ def self.xor(a, b)
16
+ and(or(a, b), not(and(a, b)))
17
17
  end
18
18
 
19
- def nor(a, b)
20
- not(my_or(a, b))
19
+ def self.nor(a, b)
20
+ not(or(a, b))
21
21
  end
22
22
 
23
- def nand(a, b)
24
- not(my_and(a, b))
23
+ def self.nand(a, b)
24
+ not(and(a, b))
25
25
  end
26
26
 
27
- def xnor(a, b)
27
+ def self.xnor(a, b)
28
28
  not(xor(a, b))
29
29
  end
30
30
 
31
- def mux(a, b, s)
32
- my_or(my_and(a, not(s)), my_and(b, s))
31
+ def self.mux(a, b, s)
32
+ or(and(a, not(s)), and(b, s))
33
33
  end
34
-
34
+
35
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logicgates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - DouglasTGordon