Some definitions have visibility. For example, methods and constants. Others don't have this concept, like instance variables or global variables.
Define a way to model visibility (should it be through bit flags?) and start keeping track of it for applicable definitions. For example:
class Foo
CONST = 1
private_constant(:CONST) # private constant
private def private_method; end
def now_public; end
protected
def now_protected; end
def self.public_because_protected_does_not_apply_here; end
def self.make_me_private; end
private_singleton_method(:make_me_private)
end
Some definitions have visibility. For example, methods and constants. Others don't have this concept, like instance variables or global variables.
Define a way to model visibility (should it be through bit flags?) and start keeping track of it for applicable definitions. For example: