Skip to content

Commit

Permalink
コンストラクタを親クラスへ移動
Browse files Browse the repository at this point in the history
  • Loading branch information
at-grandpa committed Nov 6, 2017
1 parent cece3f6 commit 613fe43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions part01/src/money_package/dollar.cr
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module MoneyPackage
class Dollar < MoneyPackage::Money
def initialize(@amount : Int32, @currency : String)
end

def times(multiplier : Int32)
Money.dollar(@amount * multiplier)
end
Expand Down
3 changes: 0 additions & 3 deletions part01/src/money_package/franc.cr
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module MoneyPackage
class Franc < MoneyPackage::Money
def initialize(@amount : Int32, @currency : String)
end

def times(multiplier : Int32)
Money.franc(@amount * multiplier)
end
Expand Down
3 changes: 3 additions & 0 deletions part01/src/money_package/money.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module MoneyPackage
abstract class Money
def initialize(@amount : Int32, @currency : String)
end

def currency
@currency
end
Expand Down

0 comments on commit 613fe43

Please sign in to comment.