Files
codeql/ruby/ql/test/library-tests/variables/instance_variables.rb
2021-10-15 11:47:28 +02:00

44 lines
310 B
Ruby

@top = 1
def foo
@foo = 10
end
def print_foo
puts @foo
end
puts @top
class X
@x = 10
def m()
@y = 7
end
end
module M
@m = 10
def n()
@n = 7
end
end
puts {
@x = 100
}
def bar
1.times { @x = 200 }
end
class C
@x = 42
def x
def y
@x = 10
end
y
p @x
end
end