Class: ROM::Components::Schema
- Defined in:
- lib/rom/components/schema.rb
Instance Method Summary collapse
- #adapter ⇒ Object private
- #build ⇒ Object
- #dataset ⇒ Object private
- #inferrer ⇒ Object private
- #relation ⇒ Object private
- #view? ⇒ Boolean private
Instance Method Details
#adapter ⇒ 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.
46 47 48 |
# File 'lib/rom/components/schema.rb', line 46 def adapter config.adapter end |
#build ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rom/components/schema.rb', line 17 def build if view? registry.schemas[config.relation].instance_eval(&block) else schema = config.constant.define( name, **config, **config., inferrer: inferrer, registry: registry ) if gateway? schema.finalize_attributes!(gateway: gateway) else schema.finalize_attributes! end schema.finalize! end end |
#dataset ⇒ 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.
41 42 43 |
# File 'lib/rom/components/schema.rb', line 41 def dataset config.dataset end |
#inferrer ⇒ 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.
36 37 38 |
# File 'lib/rom/components/schema.rb', line 36 def inferrer config.inferrer.with(enabled: config.infer) end |
#relation ⇒ 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.
51 52 53 |
# File 'lib/rom/components/schema.rb', line 51 def relation config.relation end |
#view? ⇒ Boolean
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.
56 57 58 |
# File 'lib/rom/components/schema.rb', line 56 def view? config.view.equal?(true) end |