rgate 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/rgate.rb +65 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f474f5700a9e5bc56d3aa0e410845e603360ca98
|
4
|
+
data.tar.gz: fd4847eddf0b5cb96c28b1c92efa510e306073cc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 02e3599574d48dbd91c7b8355f32ca1a2a9ee53741889179a01832e58a11f1ff0025463697716645f4bdda1a3c5be826234080809560450b72c51940052b5950
|
7
|
+
data.tar.gz: 2087242a422b04e0b2439f364fce64a66e2d2e437499422b50a4cc7c17e9e0fa644ecc8cfa6df0b8377b4efb86d8372f3dc73f749a49f065580f91e3b7f75789
|
data/lib/rgate.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
class Rgate
|
2
|
+
def and(one, two)
|
3
|
+
if one == true && two == true
|
4
|
+
return true
|
5
|
+
else
|
6
|
+
return false
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def or(one, two)
|
11
|
+
if one == true
|
12
|
+
return true
|
13
|
+
elsif two == true
|
14
|
+
return true
|
15
|
+
elsif one == true && two == true
|
16
|
+
return true
|
17
|
+
else
|
18
|
+
return false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def not(one)
|
23
|
+
if one == true
|
24
|
+
return false
|
25
|
+
else
|
26
|
+
return true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def nand(one, two)
|
31
|
+
if one == true && two == true
|
32
|
+
return false
|
33
|
+
else
|
34
|
+
return true
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def nor(one, two)
|
39
|
+
if one == false && two == false
|
40
|
+
return true
|
41
|
+
else
|
42
|
+
return false
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def xor(one, two)
|
47
|
+
if one == true && two == false
|
48
|
+
return true
|
49
|
+
elsif one == false && two == true
|
50
|
+
return true
|
51
|
+
else
|
52
|
+
return false
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def xnor(one, two)
|
57
|
+
if one == true && two == true
|
58
|
+
return true
|
59
|
+
elsif one == false && two == false
|
60
|
+
return true
|
61
|
+
else
|
62
|
+
return false
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rgate
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jonathan Tan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-05-17 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Logic gates gem for ruby. Includes AND, OR, NOT, NAND, NOR, XOR, XNOR.
|
14
|
+
email: jonathantanatlol@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/rgate.rb
|
20
|
+
homepage: https://github.com/peaceknight05/rgate
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.6.14
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Logic gates gem for ruby
|
44
|
+
test_files: []
|