[Ruby] Evolution of Eevee with Ruby

2 minute read

Hello. That’s right. I started 4/27 programming just two months ago. Currently I am studying Go exclusively, but since I did a Progate Ruby course on the first day of programming, I joined from Ruby. The reason I chose Ruby first was that it was a famous language that I hadn’t experienced two months ago, and I knew it, so I chose it because it seemed like a long one. I went through two Ruby courses over two days. I still remember clearly that I couldn’t understand at all from the second half. Lol After that, the first original app I made immediately to fix it came out when the folders were organized, so I will leave it as a record.


Its name is “Eevee”. That’s right, that eve. It’s just an app that lets you choose whether to use water stones or fire stones for Eevee and evolve it, and at the same time learn new techniques. Here is the code.


class Pokemon

    attr_accessor :name, :sex, :skill

    def initialize(name:, sex:, skill:)
        @name = name
        @sex = sex
        @skill = skill

    def who
        "Nice to meet you, it's #{@name}.\n My gender is #{@sex}.\n My special move is #{skill}."

eevee = Pokemon.new(
    skill:'Tail the tail'

puts eevee.who

class Evolution <Pokemon
    attr_accessor :new_name

    def name_change
        @new_name = "hanako"

    def who_e
        "Congratulations! Eevee has evolved into #{name}!\nI learned a new #{skill}!"

fires = Evolution.new(
    sex: nil,

showers = Evolution.new(
    skill:'Rei Ubimu'

puts "Which stone do you want to use?\nPlease select.\n\n1. Flame stone \n2. Water stone"

answer = gets.chomp.to_i

if answer == 1
    puts fires.who_e

elsif answer == 2
    puts showers.who_e

#[email protected] The display name could not be assigned to the name entered in @name. ==================

# puts "Do you want to give a nickname?\nPlease select.\n\n1.Enable\n2.Not apply"
# nickname_answer = gets.chomp.to_i

# if nickname_answer == 1 && answer ==1
# puts "Please enter a new name."
# fires.name_change
# puts "The name has changed to #{@new_name}!"
# elsif nickname_answer == 1 && answer ==2
# puts "Please enter a new name."
# showers.name_change
# puts "The name has changed to #{@new_name}!"
# else
# puts "It's done."
# end


Even though I tried to give a nickname like an actual Pokemon, I was unable to attach it, and even commented that it was difficult. Lol At this time, I felt like I was confused and why I was able to do it, so I feel that I have grown up compared to two months ago. Since I made a Twitter-like app with Rails in May, I’ve been switching to Go and playing Go all the time, but I also want to touch Ruby before I completely forget it.


I only bought the Kindle version of the Ruby book. I didn’t read much because I changed trains immediately, but it was just good for me who just finished Progate.