Class: ROM::Memory::Schema
Overview
Specialized schema for memory adapter
Constant Summary
Constants inherited from Schema
Schema::DEFAULT_INFERRER, Schema::EMPTY_ASSOCIATION_SET, Schema::HASH_SCHEMA
Constants included from ROM::Memoizable
ROM::Memoizable::MEMOIZED_HASH
Instance Attribute Summary
Attributes inherited from Schema
#associations, #attributes, #canonical, #inferrer, #name, #primary_key_name, #primary_key_names
Attributes included from ROM::Memoizable
Instance Method Summary collapse
- #call(relation) ⇒ Object
-
#finalize_associations!(relations:) ⇒ Object
private
Internal hook used during setup process.
Methods inherited from Schema
#[], #append, attributes, build_attribute_info, #canonical?, define, #each, #empty?, #exclude, #finalize!, #finalize_attributes!, #foreign_key, #initialize, #key?, #merge, #prefix, #primary_key, #project, #rename, #set!, #to_ary, #to_ast, #to_h, #to_input_hash, #to_output_hash, #uniq, #wrap
Methods included from Notifications::Listener
Methods included from Initializer
Methods included from ROM::Memoizable
Constructor Details
This class inherits a constructor from ROM::Schema
Instance Method Details
#call(relation) ⇒ Object
14 15 16 |
# File 'lib/rom/memory/schema.rb', line 14 def call(relation) relation.new(relation.dataset.project(*map(&:name)), schema: self) end |
#finalize_associations!(relations:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Internal hook used during setup process
23 24 25 26 27 28 29 |
# File 'lib/rom/memory/schema.rb', line 23 def finalize_associations!(relations:) super do associations.map do |definition| Memory::Associations.const_get(definition.type).new(definition, relations) end end end |