zdubzdab_hola 0.0.4 → 0.0.5

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: 744900f527fcc608a3b9bdba690adc7b051f170f
4
- data.tar.gz: 0ddb180bc87419a2620186af5e6259f9b19f2c2d
3
+ metadata.gz: 7eb1092488470203d75e183e09ff7b8b094d0736
4
+ data.tar.gz: aaa9b3b8835490a27025fdb92c86fe345e233eb4
5
5
  SHA512:
6
- metadata.gz: da3260647362858cd42b0e7b6299c87b6d4f0b47ad94fd1f4f9617023279753fc26df01f68b9d8bf174b9989ea4a5a1641190a3bfa128289a583430781ae72bd
7
- data.tar.gz: 55ae9c42574c21050aecc0ecbabd3cb9b13762bd3ad1a15fc77684d89282b1f7869e5535931ef2a21d23cda08a2fc37214ecb256be472f136fec8262a45e7693
6
+ metadata.gz: 11bd7d0856adaab1b4f41fc58231f3bcb71b8a1fd90d29fb0270360bbb4ea8365ee7d3d4adaba59eb7ba49d5fbc68d865a9a7d98e9b136e280d4b7911ff9623e
7
+ data.tar.gz: 56e5b84a4ede34087c8f33d2d30beaabebc9639f49bf5064d13f5d64ff53f92e9d465bf4a400f63340106f372faee3c98483b234897824085706f491140b277b
@@ -0,0 +1,10 @@
1
+ module zdubzdab_hola
2
+ module acts_as_calculator
3
+ def count_result
4
+ true_answers = Answer.belongs_to_current_test(self.id).with_true.joins(:answer_setting).where( answer_settings: {rigth: 'true'} )
5
+ all_questions = self.test_setting.questions
6
+ result = Float(true_answers.count) / all_questions.count * 100
7
+ self.update_attributes(complete_pers: result)
8
+ end
9
+ end
10
+ end
data/lib/zdubzdab_hola.rb CHANGED
@@ -1,11 +1,5 @@
1
- require 'zdubzdab_hola/core'
1
+ require 'zdubzdab_hola/acts_as_calculator'
2
2
 
3
- module MyModule
4
- # def count_result
5
- # true_answers = Answer.belongs_to_current_test(self.id).with_true.joins(:answer_setting).where( answer_settings: {rigth: 'true'} )
6
- # all_questions = self.test_setting.questions
7
- # result = Float(true_answers.count) / all_questions.count * 100
8
- # self.update_attributes(complete_pers: result)
9
- # end
3
+ module zdubzdab_hola
10
4
  end
11
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zdubzdab_hola
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - zdubzdab
@@ -10,14 +10,14 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: The simplest hello world gem
13
+ description: The simplest gem that calculate test result in percent.
14
14
  email: zdubzdab@gmail.com
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/zdubzdab_hola.rb
20
- - lib/zdubzdab_hola/core.rb
20
+ - lib/zdubzdab_hola/acts_as_calculator.rb
21
21
  homepage: http://rubygems.org/gems/zdubzdab_hola
22
22
  licenses:
23
23
  - MIT
@@ -41,5 +41,5 @@ rubyforge_project:
41
41
  rubygems_version: 2.3.0
42
42
  signing_key:
43
43
  specification_version: 4
44
- summary: Hola!
44
+ summary: Calculate test result
45
45
  test_files: []
@@ -1,5 +0,0 @@
1
- String.class_eval do
2
- def to_good
3
- "squawk! #{self}".strip
4
- end
5
- end