Class: FixtureKit::MemoryCache
- Inherits:
-
Object
- Object
- FixtureKit::MemoryCache
- Defined in:
- lib/fixture_kit/memory_cache.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#exposed ⇒ Object
readonly
Returns the value of attribute exposed.
Instance Method Summary collapse
- #data_for(coder_class) ⇒ Object
-
#initialize(data:, exposed:) ⇒ MemoryCache
constructor
A new instance of MemoryCache.
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/fixture_kit/memory_cache.rb', line 5 def data @data end |
#exposed ⇒ Object (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 |