Class: T12n::SchemaStore
- Inherits:
-
Object
- Object
- T12n::SchemaStore
- Defined in:
- lib/t12n/schema_store.rb
Instance Method Summary collapse
- #fetch(name) ⇒ Object
-
#initialize ⇒ SchemaStore
constructor
A new instance of SchemaStore.
- #save(schema) ⇒ Object
Constructor Details
#initialize ⇒ SchemaStore
Returns a new instance of SchemaStore.
5 6 7 |
# File 'lib/t12n/schema_store.rb', line 5 def initialize @schema_by_name = {} end |
Instance Method Details
#fetch(name) ⇒ Object
14 15 16 |
# File 'lib/t12n/schema_store.rb', line 14 def fetch(name) schema_by_name[name] end |
#save(schema) ⇒ Object
9 10 11 12 |
# File 'lib/t12n/schema_store.rb', line 9 def save(schema) schema_by_name[schema.name] = schema :ok end |