alinajuly / RubyHW

homework
0 stars 0 forks source link

Feedback HW 3 #5

Closed MaksHostroushko closed 1 year ago

MaksHostroushko commented 1 year ago

You did great! Let's add some changes

  1. https://github.com/alinajuly/RubyHW/blob/main/HW3/tamagotchi_with_html_gem/pet.rb#L84..L88 In this case, you duplicated the code Just use || operator if you need to do something with multiple conditions

    if want_to_eat || want_to_drink || want_to_play || want_to_hug || want_to_sleep
    @life -= 10 
    end
  2. until pet_array.include?(pet_type) do Please, try to don't use until I believe, we can resolve it in a better way

  3. Please, fix all spaces and empty blanks according to code style

  4. You have a lot of classes(for example, https://github.com/alinajuly/RubyHW/blob/main/HW3/tamagotchi_with_html_gem/dog.rb) where you have the same method Please, try to avoid duplicating

alinajuly commented 1 year ago

Thank you.

I've removed code duplication, use loop instead until, fixed spaces and empty blanks.

In the classes I use the same methods, but each class has its own text and different emoji, they are not repeated. Also, not to repeat myself, used super.