Class: AttributeDependsCalculator::Factory

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/attribute_depends_calculator/factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, column, params) ⇒ Factory

Returns a new instance of Factory.



12
13
14
15
16
# File 'lib/attribute_depends_calculator/factory.rb', line 12

def initialize(klass, column, params)
  self.klass, self.column = klass, column
  self.parameter = Parameter.new(params)
  self.association = fetch_association
end

Instance Attribute Details

#associationObject

Returns the value of attribute association.



4
5
6
# File 'lib/attribute_depends_calculator/factory.rb', line 4

def association
  @association
end

#columnObject

Returns the value of attribute column.



4
5
6
# File 'lib/attribute_depends_calculator/factory.rb', line 4

def column
  @column
end

#klassObject

Returns the value of attribute klass.



4
5
6
# File 'lib/attribute_depends_calculator/factory.rb', line 4

def klass
  @klass
end

#parameterObject

Returns the value of attribute parameter.



6
7
8
# File 'lib/attribute_depends_calculator/factory.rb', line 6

def parameter
  @parameter
end

Instance Method Details

#performObject



18
19
20
21
# File 'lib/attribute_depends_calculator/factory.rb', line 18

def perform
  define_calculator
  append_callbacks
end