lotto 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/lotto/draw.rb +7 -3
- data/lib/lotto/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3c86ed5eb80bc4ac4072c8f975dde62b91e013ac2b54168e85196fff6709f5c
|
4
|
+
data.tar.gz: 2369ef36070b4fde36139c5b861ee0ead0841b9ad8185d7ab8fd13fad8a40eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9e15215bf0ee1a57683834081ff6608c00a5225477131cac285b2ec5bdfe667b7de2b65e4d6699292166b5f5692e49d830d53699b165a0d7e3eb335e5c6398e
|
7
|
+
data.tar.gz: 32b4fd813f64cd84aaff7fe4ab5b1376cc9eaf57119fcdfb54fde3a87d40feb6a31be8db082ede01c53db24957fe0e2722b77564fcab9bf4ecf0b8eea023d9d9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/lotto/draw.rb
CHANGED
@@ -7,7 +7,9 @@ module Lotto
|
|
7
7
|
|
8
8
|
def draw
|
9
9
|
drawns = []
|
10
|
-
@options[:
|
10
|
+
@options[:include].each{ |n| drawns << n } unless @options[:include].nil?
|
11
|
+
count = @options[:include] ? @options[:pick] - @options[:include].count : @options[:pick]
|
12
|
+
count.times{ drawns << pick(drawns) }
|
11
13
|
drawns
|
12
14
|
end
|
13
15
|
|
@@ -22,8 +24,10 @@ module Lotto
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def basket
|
25
|
-
|
26
|
-
|
27
|
+
numbers = (1..@options[:of])
|
28
|
+
numbers = numbers.reject{ |n| @options[:include].include? n } unless @options[:include].nil?
|
29
|
+
numbers = numbers.reject{ |n| @options[:exclude].include? n } unless @options[:exclude].nil?
|
30
|
+
numbers
|
27
31
|
end
|
28
32
|
end
|
29
33
|
end
|
data/lib/lotto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lotto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Onur Kucukkece
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|