heuristics 0.0.2 → 0.0.3
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.
- data/README.md +3 -3
- data/lib/heuristics/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
|
@@ -8,8 +8,8 @@ A typical simple example can look like this:
|
|
|
8
8
|
assume_default :integer
|
|
9
9
|
|
|
10
10
|
assume(:string) { condition { value.instance_of? String } }
|
|
11
|
-
|
|
12
|
-
assume(:date)
|
|
11
|
+
assume(:hash) { condition { value.instance_of? Hash } }
|
|
12
|
+
assume(:date) { condition { Chronic.parse(value) != nil } }
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
Then you can use it like this
|
|
@@ -58,7 +58,7 @@ Or install it yourself as:
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
# An assumption that will return :date if all conditions return true
|
|
61
|
-
assume(:date) {
|
|
61
|
+
assume(:date) { condition { Chronic.parse(value) != nil } }
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
|
data/lib/heuristics/version.rb
CHANGED