Module: Maestrano::Connector::Rails::Concerns::SubEntityBase::ClassMethods
- Defined in:
- app/models/maestrano/connector/rails/concerns/sub_entity_base.rb
Instance Method Summary collapse
- #connec_entity_name ⇒ Object
-
#creation_mapper_classes ⇒ Object
{ ‘External Entity’ => CreationLalaMapper, ‘Other external entity’ => CreationLiliMapper } or { ‘Connec Entity’ => CreationLalaMapper, ‘Other connec entity’ => CreationLiliMapper }.
- #entity_name ⇒ Object
- #external? ⇒ Boolean
- #external_entity_name ⇒ Object
-
#mapper_classes ⇒ Object
{ ‘External Entity’ => LalaMapper, ‘Other external entity’ => LiliMapper } or { ‘Connec Entity’ => LalaMapper, ‘Other connec entity’ => LiliMapper }.
- #names_hash ⇒ Object
-
#references ⇒ Object
{ ‘External Entity’ => [‘organization_id’], ‘Other external entity’ => [‘an array of the connec reference fields’] }.
Instance Method Details
#connec_entity_name ⇒ Object
19 20 21 22 23 |
# File 'app/models/maestrano/connector/rails/concerns/sub_entity_base.rb', line 19 def connec_entity_name return entity_name unless external? raise 'Forbidden call: cannot call connec_entity_name for an external entity' end |
#creation_mapper_classes ⇒ Object
{ ‘External Entity’ => CreationLalaMapper, ‘Other external entity’ => CreationLiliMapper } or { ‘Connec Entity’ => CreationLalaMapper, ‘Other connec entity’ => CreationLiliMapper }
41 42 43 |
# File 'app/models/maestrano/connector/rails/concerns/sub_entity_base.rb', line 41 def creation_mapper_classes mapper_classes end |
#entity_name ⇒ Object
9 10 11 |
# File 'app/models/maestrano/connector/rails/concerns/sub_entity_base.rb', line 9 def entity_name raise 'Not implemented' end |
#external? ⇒ Boolean
5 6 7 |
# File 'app/models/maestrano/connector/rails/concerns/sub_entity_base.rb', line 5 def external? raise 'Not implemented' end |
#external_entity_name ⇒ Object
13 14 15 16 17 |
# File 'app/models/maestrano/connector/rails/concerns/sub_entity_base.rb', line 13 def external_entity_name return entity_name if external? raise 'Forbidden call: cannot call external_entity_name for a connec entity' end |
#mapper_classes ⇒ Object
{ ‘External Entity’ => LalaMapper, ‘Other external entity’ => LiliMapper } or { ‘Connec Entity’ => LalaMapper, ‘Other connec entity’ => LiliMapper }
35 36 37 |
# File 'app/models/maestrano/connector/rails/concerns/sub_entity_base.rb', line 35 def mapper_classes {} end |
#names_hash ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/models/maestrano/connector/rails/concerns/sub_entity_base.rb', line 25 def names_hash if external? {external_entity: entity_name.downcase} else {connec_entity: entity_name.downcase} end end |
#references ⇒ Object
'External Entity' => ['organization_id'],
'Other external entity' => ['an array of the connec reference fields']
49 50 51 |
# File 'app/models/maestrano/connector/rails/concerns/sub_entity_base.rb', line 49 def references {} end |