class EY::CloudClient::ModelRegistry
Public Class Methods
new()
click to toggle source
# File lib/engineyard-cloud-client/model_registry.rb, line 4 def initialize @registry = Hash.new { |h,k| h[k] = {} } end
Public Instance Methods
find(klass, id)
click to toggle source
# File lib/engineyard-cloud-client/model_registry.rb, line 8 def find(klass, id) if id @registry[klass][id] end end
set(klass, id, obj)
click to toggle source
# File lib/engineyard-cloud-client/model_registry.rb, line 14 def set(klass, id, obj) if id && obj @registry[klass][id] = obj end end