Class: Rupee::Curve
- Inherits:
-
Object
- Object
- Rupee::Curve
- Includes:
- FindInstance
- Defined in:
- lib/rupee/curve.rb,
lib/rupee/curve/libor_3m.rb
Overview
A class representing a yield or basis curve
Constant Summary collapse
- LIBOR_3M =
Curve.new("3-month LIBOR")
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
The curve’s currency.
-
#description ⇒ Object
readonly
A description for the curve.
-
#interpolation ⇒ Object
readonly
The interpolation method.
Instance Method Summary collapse
-
#initialize(description = "", opts = {}) ⇒ Curve
constructor
Create a new curve.
Methods included from FindInstance
Constructor Details
#initialize(description = "", opts = {}) ⇒ Curve
Create a new curve
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rupee/curve.rb', line 16 def initialize(description = "", opts = {}) opts = { :currency => :usd, :interpolation => :cubic_spline }.merge opts @description = description @currency = opts[:currency] @interpolation = opts[:interpolation] end |
Instance Attribute Details
#currency ⇒ Object (readonly)
The curve’s currency
9 10 11 |
# File 'lib/rupee/curve.rb', line 9 def currency @currency end |
#description ⇒ Object (readonly)
A description for the curve
11 12 13 |
# File 'lib/rupee/curve.rb', line 11 def description @description end |
#interpolation ⇒ Object (readonly)
The interpolation method
13 14 15 |
# File 'lib/rupee/curve.rb', line 13 def interpolation @interpolation end |