Class: ROM::Components::Mapper
- Defined in:
- lib/rom/components/mapper.rb
Instance Attribute Summary collapse
-
#constant ⇒ Class
readonly
Component's target class.
-
#object ⇒ Class
readonly
Pre-initialized object that should be used instead of the constant.
Instance Method Summary collapse
Instance Attribute Details
#constant ⇒ Class (readonly)
Returns Component's target class.
11 |
# File 'lib/rom/components/mapper.rb', line 11 option :constant, type: Types.Interface(:new), optional: true |
#object ⇒ Class (readonly)
Returns Pre-initialized object that should be used instead of the constant.
16 |
# File 'lib/rom/components/mapper.rb', line 16 option :object, optional: true |
Instance Method Details
#build ⇒ Object
19 20 21 |
# File 'lib/rom/components/mapper.rb', line 19 def build object || constant.build end |
#relation ⇒ Object
24 25 26 |
# File 'lib/rom/components/mapper.rb', line 24 def relation config.relation end |