Class: Pivorak::Mark

Inherits:
Object
  • Object
show all
Defined in:
lib/pivorak.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(point) ⇒ Mark

Returns a new instance of Mark.



7
8
9
# File 'lib/pivorak.rb', line 7

def initialize(point)
  @point = point
end

Instance Attribute Details

#pointObject (readonly)

Returns the value of attribute point.



5
6
7
# File 'lib/pivorak.rb', line 5

def point
  @point
end

Instance Method Details

#feedbackObject



11
12
13
14
15
16
17
18
# File 'lib/pivorak.rb', line 11

def feedback
  case point
  when -1 then 'Pffffff... where is your homework?'
  when 0 then 'Not nice. You should try better next time'
  when 1 then 'Good job!'
  else 'Wowow... only -1, 0 or 1 allowed'
  end
end