D3XT3R
D3XT3R

Reputation: 171

What does this initialization of Class Variable mean in Ruby

I have three ruby scripts say, A.rb, B.rb and Call.rb.

I have a class variable @@classvar in Call.rb and I am initializing it like, @@classvar=[:A,:B].

What does the above statement actually do?

Upvotes: 1

Views: 90

Answers (1)

alex
alex

Reputation: 490263

@@classvar=[:A,:B]

It means, set class method, or static method with name classvar as an array with two symbols, :A and :B.

Upvotes: 2

Related Questions