четверг, 3 октября 2013 г.

Ruby :: Instance Variables and Accessors

class Item
 
  def initialize(description, color)
    @description = description
    @color = color
  end
 
  def description=(new_description)
    @description = new_description
  end
   
  def color=(new_color)
    @color = new_color
  end
   
end



rubymonk.com/learning/books/4-ruby-primer-ascent/chapters/45-more-classes/lessons/110-instance-variables#solution4434

Комментариев нет:

Отправить комментарий