Permalink
Browse files

Better naming for basic fixed income product

  • Loading branch information...
1 parent 149d93b commit c64c7ec6d064c3f279c47029abb82215af1a1efb @brymck committed Oct 3, 2011
Showing with 16 additions and 11 deletions.
  1. +1 −1 lib/rupee.rb
  2. +2 −2 lib/rupee/day_count.rb
  3. +5 −7 lib/rupee/{custom.rb → fixed_income.rb}
  4. +1 −1 lib/rupee/version.rb
  5. +7 −0 spec/ruby/fixed_income_spec.rb
View
@@ -21,7 +21,7 @@ module Rupee
autoload :Benchmark, "rupee/benchmark"
autoload :BusinessDay, "rupee/business_day"
autoload :Calendar, "rupee/calendar"
- autoload :Custom, "rupee/custom"
+ autoload :FixedIncome, "rupee/fixed_income"
autoload :Call, "rupee/option"
autoload :Currency, "rupee/currency"
autoload :DayCount, "rupee/day_count"
View
@@ -4,8 +4,6 @@ module Rupee
# A class representing a day count convention used to determine cash flow
# and accrual dates for fixed income products
class DayCount
- include FindInstance
-
autoload :THIRTY_360, "rupee/day_count/30_360"
autoload :THIRTY_E_360, "rupee/day_count/30e_360"
autoload :THIRTY_E_360_ISDA, "rupee/day_count/30e_360_isda"
@@ -30,6 +28,8 @@ def factor(from, to)
end
class << self
+ include FindInstance
+
# The number of seconds in a day (a difference of <tt>1</tt> between two
# dates in Ruby indicates a difference of one second)
SECONDS_PER_DAY = 86_400.0
@@ -1,10 +1,8 @@
module Rupee
- # Under construction
- #
- # A custom security that allows the user to specify cash flows, discount
- # curves, payout curves, calendars, currencies, daycounts, roll day
+ # A basic fixed income security that allows the user to specify cash flows,
+ # discount curves, payout curves, calendars, currencies, daycounts, roll day
# conventions, etc.
- class Custom < Security
+ class FixedIncome < Security
# The security's business day convention
attr :business_day
# The calendar used for determining holidays
@@ -55,10 +53,10 @@ class Custom < Security
# require "rupee"
#
# # A typical pay-fixed bond
- # bond = Rupee::Custom.new
+ # bond = Rupee::FixedIncome.new
#
# # A typical yen LIBOR security
- # bond = Rupee::Custom.new :calendar => :japan, :currency => :yen,
+ # bond = Rupee::FixedIncome.new :calendar => :japan, :currency => :yen,
# :day_count => :act_365
def initialize(opts = {})
opts = {
View
@@ -1,4 +1,4 @@
module Rupee
# The current version
- VERSION = "0.2.6"
+ VERSION = "0.2.6.1"
end
@@ -0,0 +1,7 @@
+require File.dirname(__FILE__) + "/../spec_helper"
+
+describe FixedIncome do
+ it "should be able to instantiate a basic fixed income product" do
+ lambda { FixedIncome.new }.should_not raise_error
+ end
+end

0 comments on commit c64c7ec

Please sign in to comment.