Do I have create extra method for this kind of assignment? @@variable = @global_variable
Why? I want to have some variables that hold values and definitions to be accessible all through my script and have only one place of definition.
@global_variable = 'test'
class Test
@@variable = @global_variable
def self.display
puts @@variable
end
end
Test.display #gives nil