Class: One44::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/one44-core/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResult

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

#marksObject (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

#correctObject



15
16
17
# File 'lib/one44-core/result.rb', line 15

def correct
  @marks.map.select { |mark| mark == 'CORRECT' }
end