Class: T12n::SchemaStore

Inherits:
Object
  • Object
show all
Defined in:
lib/t12n/schema_store.rb

Instance Method Summary collapse

Constructor Details

#initializeSchemaStore

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