Class: BondCalculator::Bond
- Inherits:
-
Object
- Object
- BondCalculator::Bond
- Defined in:
- lib/bond_calculator/bond.rb
Overview
Bond is a PORO that represent the structure of benchmark and curve cvs’s header
Instance Attribute Summary collapse
- #name ⇒ Object readonly
- #term_years ⇒ Object readonly
- #type ⇒ Object readonly
- #yield_percent ⇒ Object readonly
Instance Method Summary collapse
- #initialize(args) ⇒ <void> constructor
Constructor Details
#initialize(args) ⇒ <void>
23 24 25 26 27 28 |
# File 'lib/bond_calculator/bond.rb', line 23 def initialize(args) @type = format_type(args['type']) @name = format_bond(args['bond']) @term_years = format_term(args['term']) @yield_percent = format_yield(args['yield']) end |
Instance Attribute Details
#name ⇒ Object (readonly)
12 13 14 |
# File 'lib/bond_calculator/bond.rb', line 12 def name @name end |
#term_years ⇒ Object (readonly)
12 13 14 |
# File 'lib/bond_calculator/bond.rb', line 12 def term_years @term_years end |
#type ⇒ Object (readonly)
12 13 14 |
# File 'lib/bond_calculator/bond.rb', line 12 def type @type end |
#yield_percent ⇒ Object (readonly)
12 13 14 |
# File 'lib/bond_calculator/bond.rb', line 12 def yield_percent @yield_percent end |