我有一个名为 Movie 的课程:
class Movie
attr_accessor :title, :director, :date_of_issue, :register_number
def initialize(title, director, date_of_issue, register_number)
@title, @director, @date_of_issue, @register_numver = title, director, date_of_issue, register_number
end
def Basic_info
puts "Title : #{@tytul}, Director: #{@autor}"
end
end
我想创建一个方法来更改现有 Movie 对象的变量,而不创建一个全新的对象。可能吗?如果是这样,怎么做?