Method: ActiveFedora::Scoping::ScopeRegistry.value_for

Defined in:
lib/active_fedora/scoping.rb

.value_for(scope_type, model) ⇒ Object

Obtains the value for a given scope_type and model.



77
78
79
80
81
82
83
84
85
86
# File 'lib/active_fedora/scoping.rb', line 77

def self.value_for(scope_type, model)
  raise_invalid_scope_type!(scope_type)
  klass = model
  base = model.base_class
  while klass <= base
    value = registry[scope_type][klass.name]
    return value if value
    klass = klass.superclass
  end
end