Skip to content

Instantly share code, notes, and snippets.

@zdavatz
Created March 14, 2011 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdavatz/868888 to your computer and use it in GitHub Desktop.
Save zdavatz/868888 to your computer and use it in GitHub Desktop.
cache_entry.rb - ODBA
def odba_cut_connections!
@accessed_by.each { |object_id, odba_id|
if((item = odba_id2ref(odba_id) || object_id2ref(object_id, odba_id)) \
&& item.respond_to?(:odba_cut_connection))
item.odba_cut_connection(_odba_object)
end
}
end
@zdavatz
Copy link
Author

zdavatz commented Mar 14, 2011

The '@accessced_by' is set in the 'initialize' method as a Hash instance.

The '@accessced_by' Hash instance is the return value of the method 'odba_cut_connections!'

@mhatakeyama
Copy link

@accessed_by = {1=>2, 3=>4}

def test
@accessed_by.each do |k,v|
print k, " ", v, "\n"
end
return @accessed_by
end

p test

output:
1 2
3 4
{1=>2, 3=>4}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment