was 0.1.0 → 0.2.0
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 +4 -4
- data/README.md +21 -0
- data/lib/was/score.rb +1 -1
- data/lib/was/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: dec886b6732bed51319bb2b25188fdb8bfaebc1a731ed2586b3b048d06e31253
|
|
4
|
+
data.tar.gz: 15a9386c210b0b7f996b1c96890bfaf20b5006e9c492f6078ad55195b34654c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2eceb9767ae5b5e96117c59dc5d38170fdeb01947b6a4dc3691040065e750dd5e83c9d18c38c79f10ecb72bf4167de4dcae2702c466f1b5810a71d4122e21369
|
|
7
|
+
data.tar.gz: 29b21a7e3e39272fae787029e7e4c73cf2bc74abfe3369142c08b98eb1f0613c40c19738e2741094de743cfa68496ffa416837d29454e856ce2ba9b3b6172dff
|
data/README.md
CHANGED
|
@@ -20,6 +20,8 @@ Scenario:
|
|
|
20
20
|
### Define score classes
|
|
21
21
|
|
|
22
22
|
```ruby
|
|
23
|
+
require "was"
|
|
24
|
+
|
|
23
25
|
class ReportScore < WAS::Score
|
|
24
26
|
maximum_score 1000
|
|
25
27
|
|
|
@@ -58,3 +60,22 @@ ReportScore.new(
|
|
|
58
60
|
).calculate
|
|
59
61
|
#> 250
|
|
60
62
|
````
|
|
63
|
+
|
|
64
|
+
### Compose without generating a total score
|
|
65
|
+
|
|
66
|
+
Omitting the `maximum_score` will return a composed percentage represented as a value between `0` and `1`.
|
|
67
|
+
|
|
68
|
+
```ruby
|
|
69
|
+
class ComposedScore < WAS::Score
|
|
70
|
+
with "ExamScore", weight: 0.75
|
|
71
|
+
with "PracticalScore", weight: 0.25
|
|
72
|
+
end
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```ruby
|
|
76
|
+
ComposedScore.new({
|
|
77
|
+
exam: "A",
|
|
78
|
+
practical: 5
|
|
79
|
+
}).calculate
|
|
80
|
+
#> 0.875
|
|
81
|
+
```
|
data/lib/was/score.rb
CHANGED
data/lib/was/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: was
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mark Connell
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-02-
|
|
11
|
+
date: 2025-02-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A simple gem/dsl for generating Weighted Average Score calculations.
|
|
14
14
|
email:
|