Class: Paquito::SafeYAML::RestrictedYAMLTree::DispatchCache

Inherits:
Object
  • Object
show all
Defined in:
lib/paquito/safe_yaml.rb

Instance Method Summary collapse

Constructor Details

#initialize(visitor, cache) ⇒ DispatchCache

Returns a new instance of DispatchCache.



55
56
57
58
# File 'lib/paquito/safe_yaml.rb', line 55

def initialize(visitor, cache)
  @visitor = visitor
  @cache = cache
end

Instance Method Details

#[](klass) ⇒ Object



60
61
62
# File 'lib/paquito/safe_yaml.rb', line 60

def [](klass)
  @cache[klass] if @visitor.permitted_class?(klass)
end