ibham 0.1.3 → 0.1.4

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: 22773a5276f0ef750a2db5513314e96e0efe8093
4
- data.tar.gz: 5ca1cf25287eb58391af77cec4d79555a98943cf
3
+ metadata.gz: 4ce92be3e70882f8ed9a7dcdb32fac289e369f16
4
+ data.tar.gz: 2416dbbf7db79a5f118e1d0cb2bd9a36322b7244
5
5
  SHA512:
6
- metadata.gz: 24045afcc41bec10e7e197f41191f402ae98402f9e2c43523e60104971e23d9325135d0c20b94e780786f836d81e41f2cefeba5916fd74dacb794ce7abf6433b
7
- data.tar.gz: ac0b566e3d53016118eab374931e52102e40ad8b9bcd95925d1e65ad2b6b0a791ea09592185a7ed9201f15756b274fa19b52b84d893b59d4ae18a260c63cc8e1
6
+ metadata.gz: 28c0d2b9c5b68346eed325c839748afd884f3dd7a80ca088f9f84caa41404e117fb43ed753ac5cc32837e830f528ed114364535496f0fb85d6316c09edf4eba7
7
+ data.tar.gz: 1d0fbe3db0de1e7be9c97938c8ea7b99e2246c78ec871adee857c927e84f35f532755c1e9ed747527956a4deed2a6684bc4faa46605726499ab0555556e53c71
@@ -20,5 +20,9 @@
20
20
  ## v0.1.3
21
21
 
22
22
  * Drop support for Ruby < 1.9
23
- * Add method: vote_result
23
+ * Add method: vote_sum
24
24
  * Clean up code and comments
25
+
26
+ ## v0.1.4
27
+
28
+ * Rename vote_result to vote_sum
data/README.md CHANGED
@@ -42,8 +42,8 @@ The user can cast votes in the following ways:
42
42
  user = User.create
43
43
  item = Item.create
44
44
 
45
- user.vote_up(item) # Adds a positive vote
46
- user.vote_down(item) # Adds a negative vote
45
+ user.vote_up(item) # Adds a positive vote
46
+ user.vote_down(item) # Adds a negative vote
47
47
 
48
48
  Since a user can cast only one vote per item, to check if the user can
49
49
  cast vote for an item:
@@ -54,13 +54,13 @@ cast vote for an item:
54
54
 
55
55
  To retrieve the votes:
56
56
 
57
- item.up_votes # Returns the total number of positive votes
58
- item.down_votes # Returns the total number of negative votes
57
+ item.up_votes # Returns the total number of positive votes
58
+ item.down_votes # Returns the total number of negative votes
59
59
 
60
- item.up_percentage # Returns the percentage of positive votes
61
- item.down_percentage # Returns the percentage of negative votes
60
+ item.up_percentage # Returns the percentage of positive votes
61
+ item.down_percentage # Returns the percentage of negative votes
62
62
 
63
- item.vote_result # Retuns the result of votes
63
+ item.vote_sum # Retuns the result of votes
64
64
 
65
65
  For more information visit [the documentation
66
66
  page](http://rubydoc.info/github/bloc40/ibham/master/frames).
@@ -80,11 +80,11 @@ module Ibham
80
80
  votes.where(value: -ALLOWED_VALUE).map(&:voter)
81
81
  end
82
82
 
83
- # To get the result of the votes, call <tt>vote_result</tt> on the
83
+ # To get the result of the votes, call <tt>vote_sum</tt> on the
84
84
  # voteable object.
85
85
  #
86
- # item.vote_result
87
- def vote_result
86
+ # item.vote_sum
87
+ def vote_sum
88
88
  votes.sum(:value)
89
89
  end
90
90
  end
@@ -1,3 +1,3 @@
1
1
  module Ibham
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
@@ -67,10 +67,10 @@ describe 'ActsAsVoteable' do
67
67
  end
68
68
  end
69
69
 
70
- describe '#vote_result' do
71
- it 'returns the result of the votes per item' do
72
- item.vote_result.must_equal 1
73
- item2.vote_result.must_equal -1
70
+ describe '#vote_sum' do
71
+ it 'returns the sum of the votes per item' do
72
+ item.vote_sum.must_equal 1
73
+ item2.vote_sum.must_equal -1
74
74
  end
75
75
  end
76
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibham
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamal El Milahi