When Ruby sees a single word, it always checks first whether there is a local variable with that name. If not, it tries to call the method:
>> def foo .. "bar" .. end => nil >> foo = "lala" => "lala" >> foo => "lala" >>
If it cannot resolve the name as a local var or method, you will receive the following error:
>> bar NameError: undefined local variable or method `bar' for #<Object:0x000001008b8e58> from (irb):1
Since you have not previously assigned 'global_variables', this should be a method.
source share