Title / Description
Code class WorkoutLog attr_accessor :name, :current_weight,:date, :gym, :duration, :muscle_group attr_reader :total_exersises def initialize(name, current_weight, date, gym, duration, muscle_group) @name = name @current_weight = current_weight @date = date @gym = gym @duration = duration @muscle_group = muscle_group @total_exersises = [] end def add_exersise(*exersise) @total_exersises << exersise end def rate_workout case @duration when (0..15) puts "Woah what was that? no pain no gain remember? that was a short one" when (16..30) puts "Not bad but there's plenty of room for improvement" when (30..90) puts "That was a good duration." when (90..120) puts "There's a good chance you're over training." when (120..Float::INFINITY) puts "LEAVE THE GYM NOW!" else puts "that wasn't a valid number" end end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code