Here is my ruby code
class Demo attr_accessor :lines def initialize(lines) self.lines = lines end end
In the above code I could have
The main difference would be if you redefined lines= to do something other than @lines = lines.
lines=
@lines = lines
For example, you could add validation to the attribute (for example, raising if lines is empty).
lines