class Ivar::Manifest
def get_declaration(name)
-
(Declaration, nil)
- The declaration, or nil if not found
Parameters:
-
name
(Symbol, String
) -- The variable name
def get_declaration(name) name = name.to_sym # Check in this manifest first return @declarations_by_name[name] if @declarations_by_name.key?(name) # Then check in ancestor manifests, starting from the closest ancestor ancestor_manifests.each do |ancestor_manifest| if ancestor_manifest.declarations_by_name.key?(name) return ancestor_manifest.declarations_by_name[name] end end nil end