Class: IttfPoints::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/ittf_points/cli.rb

Instance Method Summary collapse

Instance Method Details

#player(points, weight = :W2) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ittf_points/cli.rb', line 8

def player(points, weight = :W2)
  player = Player.new(rating_points: points, weight: weight)
  if options[:win]
    player.win(options[:win])
  end
  if options[:lose]
    player.lose(options[:lose])
  end
  puts "New Added Rating Points: #{player.new_added_rating_points}"
  puts "New Rating Points: #{player.new_rating_points}"
end