class UserPrinter
Attributes
pastel[R]
user[R]
Public Class Methods
new(user)
click to toggle source
# File lib/ft_42.rb, line 414 def initialize(user) @pastel = Pastel.new @user = user end
Public Instance Methods
all()
click to toggle source
# File lib/ft_42.rb, line 419 def all name current_projects level correction_points end
contact()
click to toggle source
# File lib/ft_42.rb, line 444 def contact puts "You can contact #{user.first_name.titleize} at #{highlight(ActiveSupport::NumberHelper.number_to_phone(user.phone))}." end
correction_points()
click to toggle source
# File lib/ft_42.rb, line 438 def correction_points print "Has #{highlight(ActionView::Base.new.pluralize(user.correction_points, 'correction point'))}." grabs_pitchfork if user.correction_points > 8 puts end
current_projects()
click to toggle source
# File lib/ft_42.rb, line 430 def current_projects puts "Is working on #{highlight(user.current_projects.to_sentence)}." end
level()
click to toggle source
# File lib/ft_42.rb, line 434 def level puts "Is level #{highlight(ActiveSupport::NumberHelper.number_to_rounded(user.level, precision: 2))}" end
name()
click to toggle source
# File lib/ft_42.rb, line 426 def name puts highlight(user.full_name) end
Private Instance Methods
grabs_pitchfork()
click to toggle source
# File lib/ft_42.rb, line 454 def grabs_pitchfork print " *grabs pitchfork*" end
highlight(string)
click to toggle source
# File lib/ft_42.rb, line 450 def highlight(string) pastel.bright_green.bold(string) end