Class: ROM::Associations::ThroughIdentifier Private
- Inherits:
-
Object
- Object
- ROM::Associations::ThroughIdentifier
- Defined in:
- 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.
27 28 29 30 31 |
# File 'lib/rom/associations/through_identifier.rb', line 27 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.
14 15 16 |
# File 'lib/rom/associations/through_identifier.rb', line 14 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.
8 9 10 |
# File 'lib/rom/associations/through_identifier.rb', line 8 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.
11 12 13 |
# File 'lib/rom/associations/through_identifier.rb', line 11 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.
17 18 19 |
# File 'lib/rom/associations/through_identifier.rb', line 17 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.
22 23 24 |
# File 'lib/rom/associations/through_identifier.rb', line 22 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.
34 35 36 |
# File 'lib/rom/associations/through_identifier.rb', line 34 def to_sym source end |