- Ruby 初心者スレッド Part 55
618 :デフォルトの名無しさん[]:2014/10/08(水) 17:18:55.98 ID:qx5li64a - Struct使うメリットを教えてください。setter,getterは他の言語に比べるとRubyはattr_accessorがあるので簡単だと思うのですが。
class Point attr_accessor :x, :y end class Area < Point end と class Area < Struct.new(:x, :y) end この2つの違いを教えてください
|
|