Class: FixtureKit::MemoryCache

Inherits:
Object
  • Object
show all
Defined in:
lib/fixture_kit/memory_cache.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, exposed:) ⇒ MemoryCache

Returns a new instance of MemoryCache.



7
8
9
10
11
# File 'lib/fixture_kit/memory_cache.rb', line 7

def initialize(data:, exposed:)
  @data = data
  @exposed = exposed
  freeze
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/fixture_kit/memory_cache.rb', line 5

def data
  @data
end

#exposedObject (readonly)

Returns the value of attribute exposed.



5
6
7
# File 'lib/fixture_kit/memory_cache.rb', line 5

def exposed
  @exposed
end

Instance Method Details

#data_for(coder_class) ⇒ Object



13
14
15
# File 'lib/fixture_kit/memory_cache.rb', line 13

def data_for(coder_class)
  data.fetch(coder_class)
end