⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (400 Bytes)
Bug #1469
ยป classvars.rb
biteme (Kenneth Ballou)
, 05/15/2009 04:26 AM
class
Holder
@@var
=
99
def
Holder
.
var
=
(
val
)
@@var
=
val
end
def
Holder
.
read_var
@@var
end
def
var
@@var
end
end
@@var
=
"top level variable"
a
=
Holder
.
new
puts
"a.var:
#{
a
.
var
}
"
Holder
.
var
=
123
puts
"a.var:
#{
a
.
var
}
"
def
a
.
get_var
@@var
end
puts
"a.get_var:
#{
a
.
get_var
}
"
puts
"@@var:
#{
@@var
}
"
puts
"Holder.read_var:
#{
Holder
.
read_var
}
"
(1-1/1)
Loading...