Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Currency

  MAPPINGS = { "GBP" => "£", "EUR" => "€",
    "USD" => "$", "AUD" => "$", "CAD" => "$" }
  
  def initialize(curr)
    # default to USD if we're passed in nil for some reason
    @curr=curr || "USD"
  end
  
  def prefix
    MAPPINGS[@curr] || "#{@curr} "
  end
  
end