mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
44 lines
310 B
Ruby
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 |