Replies: 1 comment
-
| If you want it to be truly global, you could define it with a  module Kernel
  # @!method user
  #   @return [User]
end
user # recognized here
class Example
  user # and here
  def foo
    user # and here
  end
  def self.bar
    user # and here
  end
end | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to set globally variable type by name?
For example, set that the
uservariable is always an instance of theUserclass?Beta Was this translation helpful? Give feedback.
All reactions