Class: EarnedValueCalculator::Validator
- Inherits:
-
Object
- Object
- EarnedValueCalculator::Validator
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/earned_value_calculator/validator.rb
Instance Attribute Summary collapse
-
#actual_cost ⇒ Object
Returns the value of attribute actual_cost.
-
#budget ⇒ Object
Returns the value of attribute budget.
-
#current_date ⇒ Object
Returns the value of attribute current_date.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#rate ⇒ Object
Returns the value of attribute rate.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Instance Method Summary collapse
-
#initialize(start_date, end_date, current_date, budget, rate, actual_cost) ⇒ Validator
constructor
A new instance of Validator.
Constructor Details
#initialize(start_date, end_date, current_date, budget, rate, actual_cost) ⇒ Validator
Returns a new instance of Validator.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/earned_value_calculator/validator.rb', line 26 def initialize(start_date, end_date, current_date, budget, rate, actual_cost) self.start_date = start_date self.end_date = end_date self.current_date = current_date self.budget = budget self.rate = rate self.actual_cost = actual_cost raise ArgumentError, errors. unless valid? end |
Instance Attribute Details
#actual_cost ⇒ Object
Returns the value of attribute actual_cost.
10 11 12 |
# File 'lib/earned_value_calculator/validator.rb', line 10 def actual_cost @actual_cost end |
#budget ⇒ Object
Returns the value of attribute budget.
10 11 12 |
# File 'lib/earned_value_calculator/validator.rb', line 10 def budget @budget end |
#current_date ⇒ Object
Returns the value of attribute current_date.
10 11 12 |
# File 'lib/earned_value_calculator/validator.rb', line 10 def current_date @current_date end |
#end_date ⇒ Object
Returns the value of attribute end_date.
10 11 12 |
# File 'lib/earned_value_calculator/validator.rb', line 10 def end_date @end_date end |
#rate ⇒ Object
Returns the value of attribute rate.
10 11 12 |
# File 'lib/earned_value_calculator/validator.rb', line 10 def rate @rate end |
#start_date ⇒ Object
Returns the value of attribute start_date.
10 11 12 |
# File 'lib/earned_value_calculator/validator.rb', line 10 def start_date @start_date end |