Tag Archives: variables

Private Member Variables in Ruby

How can you create private member variables in Ruby? If you’re used to the attr_accessor helper, that won’t work–that makes your member variables public. You can use the @ notation, eg. @variable_name. (Attr_accessor just gives you free getters and setters.) Continue reading

Posted in Development | Tagged , , , | 1 Comment