Class: Snowly::SchemaCache
- Inherits:
-
Object
- Object
- Snowly::SchemaCache
- Includes:
- Singleton
- Defined in:
- lib/snowly/schema_cache.rb
Constant Summary collapse
- SNOWPLOW_IGLU_RESOLVER =
'http://iglucentral.com/schemas/'- @@schema_cache =
{}
Instance Method Summary collapse
-
#[](location) ⇒ String
Provides easy access to the schema cache based on its registered key.
-
#cache ⇒ Object
Accessor to the global cache.
-
#reset_cache ⇒ Object
Resets the schema cache.
Instance Method Details
#[](location) ⇒ String
Provides easy access to the schema cache based on its registered key
13 14 15 |
# File 'lib/snowly/schema_cache.rb', line 13 def [](location) @@schema_cache[location] || save_in_cache(location) end |
#cache ⇒ Object
Accessor to the global cache
23 24 25 |
# File 'lib/snowly/schema_cache.rb', line 23 def cache @@schema_cache end |
#reset_cache ⇒ Object
Resets the schema cache
18 19 20 |
# File 'lib/snowly/schema_cache.rb', line 18 def reset_cache @@schema_cache = {} end |