ruby symbol in the ruby class attr_accessor -


example

 class persion     attr_accessor :name, :age  end 

can write in format?

 class persion     attr_accessor name, age  end 

no, because ones in first example symbols, while in second example try call nonexistent name , age methods, result in exception.


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -