Class: One44::Result
- Inherits:
-
Object
- Object
- One44::Result
- Defined in:
- lib/one44-core/result.rb
Instance Attribute Summary collapse
-
#marks ⇒ Object
readonly
Returns the value of attribute marks.
Instance Method Summary collapse
- #<<(mark) ⇒ Object
- #correct ⇒ Object
-
#initialize ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
7 8 9 |
# File 'lib/one44-core/result.rb', line 7 def initialize @marks = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
25 26 27 28 |
# File 'lib/one44-core/result.rb', line 25 def method_missing(name, *args) super unless @marks.respond_to? name @marks.send(name, *args) end |
Instance Attribute Details
#marks ⇒ Object (readonly)
Returns the value of attribute marks.
5 6 7 |
# File 'lib/one44-core/result.rb', line 5 def marks @marks end |
Instance Method Details
#<<(mark) ⇒ Object
11 12 13 |
# File 'lib/one44-core/result.rb', line 11 def <<(mark) @marks << mark end |
#correct ⇒ Object
15 16 17 |
# File 'lib/one44-core/result.rb', line 15 def correct @marks.map.select { |mark| mark == 'CORRECT' } end |