Class: Pakyow::Data::Sources::Relational::Associations::Through Private
- Inherits:
-
Object
- Object
- Pakyow::Data::Sources::Relational::Associations::Through
- Extended by:
- Forwardable
- Defined in:
- lib/pakyow/data/sources/relational/associations/through.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
- #joining_source ⇒ Object private
- #joining_source_name ⇒ Object readonly private
Instance Method Summary collapse
- #dependent_source_names ⇒ Object private
-
#initialize(association, joining_source_name:) ⇒ Through
constructor
private
A new instance of Through.
- #internal! ⇒ Object private
- #internal? ⇒ Boolean private
- #left_foreign_key_field ⇒ Object private
- #left_name ⇒ Object private
- #right_foreign_key_field ⇒ Object private
- #right_name ⇒ Object private
- #type ⇒ Object private
Constructor Details
#initialize(association, joining_source_name:) ⇒ Through
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 Through.
26 27 28 29 30 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 26 def initialize(association, joining_source_name:) @association, @joining_source_name = association, Support.inflector.pluralize(joining_source_name).to_sym @internal = false end |
Instance Attribute Details
#joining_source ⇒ 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.
16 17 18 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 16 def joining_source @joining_source end |
#joining_source_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 'lib/pakyow/data/sources/relational/associations/through.rb', line 16 def joining_source_name @joining_source_name end |
Instance Method Details
#dependent_source_names ⇒ 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 'lib/pakyow/data/sources/relational/associations/through.rb', line 36 def dependent_source_names [@association.associated_source_name, @joining_source_name] end |
#internal! ⇒ 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.
60 61 62 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 60 def internal! @internal = true end |
#internal? ⇒ Boolean
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.
56 57 58 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 56 def internal? @internal == true end |
#left_foreign_key_field ⇒ 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.
44 45 46 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 44 def left_foreign_key_field :"#{left_name}_#{@association.associated_source.primary_key_field}" end |
#left_name ⇒ 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.
40 41 42 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 40 def left_name Support.inflector.singularize(@association.name).to_sym end |
#right_foreign_key_field ⇒ 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.
52 53 54 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 52 def right_foreign_key_field :"#{right_name}_#{@association.source.primary_key_field}" end |
#right_name ⇒ 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.
48 49 50 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 48 def right_name Support.inflector.singularize(@association.associated_name).to_sym end |
#type ⇒ 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.
32 33 34 |
# File 'lib/pakyow/data/sources/relational/associations/through.rb', line 32 def type :through end |