qanda 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qanda/version.rb +1 -1
- data/lib/question/multiple_choice.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1103cf13ede7744d45ab1aeabbb3dbc6e45ec279
|
4
|
+
data.tar.gz: fdc662158a8fa92e385e4b8775f43052ff27bd04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdb8199f4bdf283727e7420c2fc254d2974231bb16750eeaee02e3ee804acb92c6272e5a5bb43288fd59e94a4db68f0e611110c43046785056045468498aa472
|
7
|
+
data.tar.gz: 33d1a6802d47150618a7daa49e566d40456a3c77a5e1070e100e1cc35d0f12b30060e227bc6d5c08faff7550562e073ac941ee3fd090a80b1285d27091aa0339
|
data/lib/qanda/version.rb
CHANGED
@@ -13,8 +13,8 @@ module QandA
|
|
13
13
|
@choices = choices
|
14
14
|
raise InvalidQuestionError.new(NOT_ENOUGH_OPTIONS_ERR) unless choices.is_a?(Array) && choices.size > 1
|
15
15
|
raise InvalidQuestionError.new(DEFAULT_IS_INTEGER_ERR) unless default.nil? || answer_string_is_valid?(default)
|
16
|
-
raise InvalidQuestionError.new(
|
17
|
-
raise InvalidQuestionError.new(
|
16
|
+
raise InvalidQuestionError.new(MAXIMUM_NO_ZERO_ERR) unless @minimum > 0 && @maximum <= choices.size
|
17
|
+
raise InvalidQuestionError.new(MINIMUM_NO_ZERO_ERR) unless @maximum > 0 && @minimum <= choices.size - 1
|
18
18
|
raise InvalidQuestionError.new(MIN_GREATER_THAN_MAX) unless @maximum >= @minimum
|
19
19
|
super(message: message, default: default)
|
20
20
|
@validation = Proc.new { |answer| answer_string_is_valid?(answer) }
|