Class: DebtCeiling::Debt
- Inherits:
-
Object
- Object
- DebtCeiling::Debt
- Extended by:
- Forwardable
- Includes:
- CommonMethods
- Defined in:
- lib/debt_ceiling/debt.rb
Constant Summary collapse
- DoNotWhitelistAndBlacklistSimulateneously =
Class.new(StandardError)
Instance Method Summary collapse
-
#initialize(file_attributes) ⇒ Debt
constructor
A new instance of Debt.
- #letter_grade ⇒ Object
- #name ⇒ Object
Methods included from CommonMethods
Constructor Details
#initialize(file_attributes) ⇒ Debt
Returns a new instance of Debt.
15 16 17 18 19 20 21 |
# File 'lib/debt_ceiling/debt.rb', line 15 def initialize(file_attributes) @file_attributes = file_attributes if valid_debt? debt_components = configuration.debt_types.map {|type| type.new(file_attributes) } @debt_amount = debt_components.reduce(&:+) end end |
Instance Method Details
#letter_grade ⇒ Object
27 28 29 |
# File 'lib/debt_ceiling/debt.rb', line 27 def letter_grade .to_s.downcase.to_sym end |
#name ⇒ Object
23 24 25 |
# File 'lib/debt_ceiling/debt.rb', line 23 def name analysed_module.name || path.to_s.split('/').last end |