Class: Cuprum::Collections::Relation
- Inherits:
-
Object
- Object
- Cuprum::Collections::Relation
- Includes:
- Parameters
- Defined in:
- lib/cuprum/collections/relation.rb
Overview
Abstract class representing a group or view of entities.
Direct Known Subclasses
Defined Under Namespace
Modules: Cardinality, Disambiguation, Parameters, PrimaryKeys
Instance Attribute Summary collapse
-
#options ⇒ Hash
readonly
Additional options for the relation.
Attributes included from Parameters
#name, #plural_name, #qualified_name, #singular_name
Instance Method Summary collapse
-
#initialize(entity_class: nil, name: nil, qualified_name: nil, singular_name: nil, **options) ⇒ Relation
constructor
A new instance of Relation.
Methods included from Parameters
#entity_class, resolve_parameters, #resolve_parameters
Constructor Details
#initialize(entity_class: nil, name: nil, qualified_name: nil, singular_name: nil, **options) ⇒ Relation
Returns a new instance of Relation.
370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/cuprum/collections/relation.rb', line 370 def initialize(**parameters) relation_params = resolve_parameters(parameters) @entity_class = relation_params[:entity_class] @name = relation_params[:name] @plural_name = relation_params[:plural_name] @qualified_name = relation_params[:qualified_name] @singular_name = relation_params[:singular_name] @options = ignore_parameters(**parameters) end |
Instance Attribute Details
#options ⇒ Hash (readonly)
Returns additional options for the relation.
383 384 385 |
# File 'lib/cuprum/collections/relation.rb', line 383 def @options end |