From 96d49bf04ce77c975fe500f4d961e4a1ffed4c26 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 30 Dec 2012 14:43:00 +0200 Subject: Use sdoc to generate application code documentation --- doc/code/classes/Votes.html | 307 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 307 insertions(+) create mode 100644 doc/code/classes/Votes.html (limited to 'doc/code/classes/Votes.html') diff --git a/doc/code/classes/Votes.html b/doc/code/classes/Votes.html new file mode 100644 index 00000000000..bb786a79662 --- /dev/null +++ b/doc/code/classes/Votes.html @@ -0,0 +1,307 @@ + + + + + Votes + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
Methods
+
+ +
D
+
+ +
+ +
U
+
+ +
+ +
V
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Instance Public methods
+ +
+
+ + downvotes() + + +
+ + +
+

Return the number of -1 comments (downvotes)

+
+ + + + + + +
+ + +
+
# File app/roles/votes.rb, line 16
+def downvotes
+  notes.select(&:downvote?).size
+end
+
+
+ +
+ +
+
+ + downvotes_in_percent() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/roles/votes.rb, line 20
+def downvotes_in_percent
+  if votes_count.zero?
+    0
+  else
+    100.0 - upvotes_in_percent
+  end
+end
+
+
+ +
+ +
+
+ + upvotes() + + +
+ + +
+

Return the number of +1 comments (upvotes)

+
+ + + + + + +
+ + +
+
# File app/roles/votes.rb, line 3
+def upvotes
+  notes.select(&:upvote?).size
+end
+
+
+ +
+ +
+
+ + upvotes_in_percent() + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/roles/votes.rb, line 7
+def upvotes_in_percent
+  if votes_count.zero?
+    0
+  else
+    100.0 / votes_count * upvotes
+  end
+end
+
+
+ +
+ +
+
+ + votes_count() + + +
+ + +
+

Return the total number of votes

+
+ + + + + + +
+ + +
+
# File app/roles/votes.rb, line 29
+def votes_count
+  upvotes + downvotes
+end
+
+
+ +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.1