数値が配列として返されるのはなぜですか?Rubyのクラス継承
class Employee
def initialize(n,i,ph,ad)
@number = n, @id = i , @phone = ph, @adress =ad
end
end
class Getemploy < Employee
def get_data
return "The employee number is : #{@number} with id : #{@id} with phone #{@phone} with adress: #{@adress}"
end
end
puts Getemploy.new("1","2","3","4").get_data
# => The employee number is : ["1", "2", "3", "4"] with id : 2 with phone 3 with adress: 4
ありがとう!助けてくれた –