Class: CapsuleCRM::Associations::BelongsToFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/capsule_crm/associations/belongs_to_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#associationObject (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

Parameters:

  • value

    the value to set the attribute normalizer to.



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

Parameters:

  • value

    the value to set the attribute plural to.



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

Parameters:

  • value

    the value to set the attribute singular to.



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