Class: ROM::Associations::ThroughIdentifier Private
- Inherits:
-
Object
- Object
- ROM::Associations::ThroughIdentifier
- Defined in:
- core/lib/rom/associations/through_identifier.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #assoc_name ⇒ Object readonly private
- #source ⇒ Object readonly private
- #target ⇒ Object readonly private
Class Method Summary collapse
- .[](source, target, assoc_name = nil) ⇒ Object private
- .default_assoc_name(relation) ⇒ Object private
Instance Method Summary collapse
-
#initialize(source, target, assoc_name) ⇒ ThroughIdentifier
constructor
private
A new instance of ThroughIdentifier.
- #to_sym ⇒ Object private
Constructor Details
#initialize(source, target, assoc_name) ⇒ ThroughIdentifier
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.
Returns a new instance of ThroughIdentifier.
29 30 31 32 33 |
# File 'core/lib/rom/associations/through_identifier.rb', line 29 def initialize(source, target, assoc_name) @source = source @target = target @assoc_name = assoc_name end |
Instance Attribute Details
#assoc_name ⇒ Object (readonly)
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.
16 17 18 |
# File 'core/lib/rom/associations/through_identifier.rb', line 16 def assoc_name @assoc_name end |
#source ⇒ Object (readonly)
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.
10 11 12 |
# File 'core/lib/rom/associations/through_identifier.rb', line 10 def source @source end |
#target ⇒ Object (readonly)
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.
13 14 15 |
# File 'core/lib/rom/associations/through_identifier.rb', line 13 def target @target end |
Class Method Details
.[](source, target, assoc_name = nil) ⇒ 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.
19 20 21 |
# File 'core/lib/rom/associations/through_identifier.rb', line 19 def self.[](source, target, assoc_name = nil) new(source, target, assoc_name || default_assoc_name(target)) end |
.default_assoc_name(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.
24 25 26 |
# File 'core/lib/rom/associations/through_identifier.rb', line 24 def self.default_assoc_name(relation) Inflector.singularize(relation).to_sym end |
Instance Method Details
#to_sym ⇒ 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 'core/lib/rom/associations/through_identifier.rb', line 36 def to_sym source end |