Class: WebMock::Resources::SchemaStorage
- Inherits:
-
Hash
- Object
- Hash
- WebMock::Resources::SchemaStorage
- Defined in:
- lib/webmock-resources/schema_storage.rb
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(resource, schema) ⇒ Object
- #reload_index_stubs ⇒ Object
- #reset_sequences ⇒ Object
- #stub_resource(resource) ⇒ Object
Class Method Details
.instance ⇒ Object
4 5 6 |
# File 'lib/webmock-resources/schema_storage.rb', line 4 def self.instance @instance ||= new end |
Instance Method Details
#[](key) ⇒ Object
8 9 10 |
# File 'lib/webmock-resources/schema_storage.rb', line 8 def [] key super(key) || super(key.to_s.pluralize.to_sym) end |
#[]=(resource, schema) ⇒ Object
12 13 14 15 |
# File 'lib/webmock-resources/schema_storage.rb', line 12 def []= resource, schema stub_resource resource super resource, schema end |
#reload_index_stubs ⇒ Object
27 28 29 30 31 |
# File 'lib/webmock-resources/schema_storage.rb', line 27 def reload_index_stubs keys.each do |resource| stub_resource resource end end |
#reset_sequences ⇒ Object
17 18 19 20 21 |
# File 'lib/webmock-resources/schema_storage.rb', line 17 def reset_sequences each_value do |schema| schema.reset_sequence end end |