class IceCreamShop
attr_accessor :flavors #setter/getter mathod와 instance variable 역할
def initialize #초기 셋팅을 해줌
@flavors = []
end
def add_flavor (icecream)
@flavors << icecream
end
def remove_flavor (icecream)
@flavors.delete(icecream)
end
end
the_freeze = IceCreamShop.new
the_freeze.add_flavor "Vanilla"
the_freeze.add_flavor "Chocolate"
the_freeze.add_flavor "Strawberry"
the_freeze.flavors
# => ["Vanilla", "Chocolate", "Strawberry"]
the_freeze.remove_flavor "Vanilla"
the_freeze.flavors
# => ["Chocolate", "Strawberry"]