Class: ActiveMocker::ActiveRecord::Relationships::Relationship Private
- Inherits:
-
Object
- Object
- ActiveMocker::ActiveRecord::Relationships::Relationship
- Defined in:
- lib/active_mocker/active_record/relationships.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.
Direct Known Subclasses
Instance Attribute Summary collapse
- #name ⇒ Object readonly private
Instance Method Summary collapse
- #class_name ⇒ Object private
- #foreign_key ⇒ Object private
-
#initialize(name, options = {}) ⇒ Relationship
constructor
private
A new instance of Relationship.
- #join_table ⇒ Object private
- #options ⇒ Object private
- #through ⇒ Object private
Constructor Details
#initialize(name, options = {}) ⇒ Relationship
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 Relationship.
35 36 37 38 |
# File 'lib/active_mocker/active_record/relationships.rb', line 35 def initialize(name, ={}) @name = name @options = .reduce(HashWithIndifferentAccess.new, :merge) end |
Instance Attribute Details
#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.
33 34 35 |
# File 'lib/active_mocker/active_record/relationships.rb', line 33 def name @name end |
Instance Method Details
#class_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/active_mocker/active_record/relationships.rb', line 48 def class_name [:class_name] || name.to_s.camelize.singularize end |
#foreign_key ⇒ 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/active_mocker/active_record/relationships.rb', line 52 def foreign_key [:foreign_key] || name.to_s.foreign_key end |
#join_table ⇒ 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.
56 57 58 |
# File 'lib/active_mocker/active_record/relationships.rb', line 56 def join_table [:join_table] end |
#options ⇒ 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/active_mocker/active_record/relationships.rb', line 40 def @options.symbolize_keys end |
#through ⇒ 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/active_mocker/active_record/relationships.rb', line 44 def through [:through] end |