Module: Saru::List::Incorrect
- Included in:
- Saru::List
- Defined in:
- lib/saru/list/incorrect.rb
Instance Method Summary collapse
-
#meaning_incorrect_larger_than(number) ⇒ Object
Meaning.
- #meaning_incorrect_smaller_than(number) ⇒ Object
-
#reading_incorrect_larger_than(number) ⇒ Object
Reading.
- #reading_incorrect_smaller_than(number) ⇒ Object
-
#total_incorrect_larger_than(number) ⇒ Object
Total.
- #total_incorrect_smaller_than(number) ⇒ Object
Instance Method Details
#meaning_incorrect_larger_than(number) ⇒ Object
Meaning
6 7 8 9 10 11 |
# File 'lib/saru/list/incorrect.rb', line 6 def meaning_incorrect_larger_than number selected = items.select do |item| item.meaning_incorrect.to_i > number end Saru::List.new selected end |
#meaning_incorrect_smaller_than(number) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/saru/list/incorrect.rb', line 13 def meaning_incorrect_smaller_than number selected = items.select do |item| !item.meaning_incorrect.nil? && item.meaning_incorrect < number end Saru::List.new selected end |
#reading_incorrect_larger_than(number) ⇒ Object
Reading
22 23 24 25 26 27 |
# File 'lib/saru/list/incorrect.rb', line 22 def reading_incorrect_larger_than number selected = items.select do |item| item.reading_incorrect.to_i > number end Saru::List.new selected end |
#reading_incorrect_smaller_than(number) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/saru/list/incorrect.rb', line 29 def reading_incorrect_smaller_than number selected = items.select do |item| !item.reading_incorrect.nil? && item.reading_incorrect < number end Saru::List.new selected end |
#total_incorrect_larger_than(number) ⇒ Object
Total
38 39 40 41 42 43 44 |
# File 'lib/saru/list/incorrect.rb', line 38 def total_incorrect_larger_than number selected = items.select do |item| total_incorrect = item.meaning_incorrect.to_i + item.reading_incorrect.to_i total_incorrect > number end Saru::List.new selected end |
#total_incorrect_smaller_than(number) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/saru/list/incorrect.rb', line 46 def total_incorrect_smaller_than number selected = items.select do |item| !item.meaning_incorrect.nil? && !item.reading_incorrect.nil? && (item.meaning_incorrect + item.reading_incorrect) < number end Saru::List.new selected end |