Class: CapsuleCRM::Associations::BelongsToFinder
- Inherits:
-
Object
- Object
- CapsuleCRM::Associations::BelongsToFinder
- Defined in:
- lib/capsule_crm/associations/belongs_to_finder.rb
Instance Attribute Summary collapse
-
#association ⇒ Object
readonly
Returns the value of attribute association.
-
#normalizer ⇒ Object
writeonly
Sets the attribute normalizer.
-
#plural ⇒ Object
writeonly
Sets the attribute plural.
-
#singular ⇒ Object
writeonly
Sets the attribute singular.
Instance Method Summary collapse
- #call(id) ⇒ Object
-
#initialize(association) ⇒ BelongsToFinder
constructor
A new instance of BelongsToFinder.
Constructor Details
#initialize(association) ⇒ BelongsToFinder
Returns a new instance of BelongsToFinder.
7 8 9 |
# File 'lib/capsule_crm/associations/belongs_to_finder.rb', line 7 def initialize(association) @association = association end |
Instance Attribute Details
#association ⇒ Object (readonly)
Returns the value of attribute association.
4 5 6 |
# File 'lib/capsule_crm/associations/belongs_to_finder.rb', line 4 def association @association end |
#normalizer=(value) ⇒ Object
Sets the attribute normalizer
5 6 7 |
# File 'lib/capsule_crm/associations/belongs_to_finder.rb', line 5 def normalizer=(value) @normalizer = value end |
#plural=(value) ⇒ Object
Sets the attribute plural
5 6 7 |
# File 'lib/capsule_crm/associations/belongs_to_finder.rb', line 5 def plural=(value) @plural = value end |
#singular=(value) ⇒ Object
Sets the attribute singular
5 6 7 |
# File 'lib/capsule_crm/associations/belongs_to_finder.rb', line 5 def singular=(value) @singular = value end |
Instance Method Details
#call(id) ⇒ Object
11 12 13 |
# File 'lib/capsule_crm/associations/belongs_to_finder.rb', line 11 def call(id) id ? find(id) : [] end |