rasam 0.2.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bf3ad16bbfdd67137530a36c519a69ac7baff35
4
- data.tar.gz: 4f7fd4c052a1ee34951279e30dbb44d7e1e0fefc
3
+ metadata.gz: edb330f4a39afa919a29872b4249db6d69508633
4
+ data.tar.gz: 42ce22267bff052d5fbccd87503de4ea949a2035
5
5
  SHA512:
6
- metadata.gz: 3c9c7f6de5ddc94537bfee6a75198b1ac601a324abe076bb3a60f001412567ec1ddfc3948393f8bcd3ead9d01af2011360eee7cd4466686481978a611862c7de
7
- data.tar.gz: 1dd0f90a902b09c1e6b1c597a666d53f82b92c1b739953ee632d09a590f56caba6343368b0ab66545c0557f927269f4e1b5be69bc5bc01cdf9f00bd7768e58e3
6
+ metadata.gz: 8e78d630959c5df719f4f591b5201bd6536fe260e97975218612fd747e7dccc3c0aac53bc36787d5dd693545efae1ae541d8132d8c50451c42516aec873e8336
7
+ data.tar.gz: a57da9411abc696ae28bcb13b7bc0defb5f82d46cf3d722ec3eff699da9cb4209ead5c613e39b6d4ce822c17b3ad2ed311c6ebecf16cd30d1f5517473197d7e8
@@ -62,65 +62,20 @@ module Rasam
62
62
  result
63
63
  end
64
64
 
65
- private
66
-
67
- def tie(a, b)
68
- a == b
69
- end
70
- end
71
-
72
- class Engine
73
- def initialize(options, pair, choice, criteria)
74
- @pr = PairRank.new(options)
75
- rc = RationalChoice.new(pair, choice, criteria)
76
- @pr.make(rc)
65
+ def break_tie(pair, choice, criteria)
66
+ make_rational_choice(pair, choice, criteria)
77
67
  end
78
68
 
79
- def pair_for(choice)
80
- @pr.pair_for(choice)
69
+ def make_rational_choice(pair, choice, criteria)
70
+ rc = RationalChoice.new(pair, choice, criteria)
71
+ make(rc)
81
72
  end
82
73
 
83
- def score_for(choice)
84
- @pr.score_for(choice)
85
- end
74
+ private
86
75
 
87
- def rationale_for(choice)
88
- @pr.rationale_for(choice)
76
+ def tie(a, b)
77
+ a == b
89
78
  end
90
79
  end
91
-
92
- # Simulates a complete session
93
- class Simulator
94
- def initialize(options, choices, criteria)
95
- @pr = PairRank.new(options)
96
- @choices = choices
97
- @criteria = criteria
98
- end
99
-
100
- def simulate
101
- @pr.combinations.each_with_index do |pair, index|
102
- choice = @choices[index]
103
-
104
- rc = RationalChoice.new(pair, choice, @criteria)
105
- @pr.make(rc)
106
- end
107
- end
108
-
109
- def score_for(choice)
110
- @pr.score_for(choice)
111
- end
112
80
 
113
- def tied_pair
114
- @pr.tied_pair
115
- end
116
-
117
- def break_tie(pair, choice, criteria)
118
- rc = RationalChoice.new(pair, choice, criteria)
119
- @pr.make(rc)
120
- end
121
-
122
- def decisions
123
- @pr.decisions
124
- end
125
- end
126
81
  end
@@ -1,3 +1,3 @@
1
1
  module Rasam
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.10"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
- spec.add_development_dependency "minitest"
24
+ spec.add_development_dependency "minitest", "~> 5.4"
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bala Paranj
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '5.4'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '5.4'
55
55
  description: Select a single winner using votes that express preferences. This can
56
56
  also be used to create a sorted list of winners
57
57
  email: