Class: ISO4217::Currency

Inherits:
Object
  • Object
show all
Defined in:
lib/iso4217/currency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, sign, name) ⇒ Currency

Returns a new instance of Currency.



5
6
7
# File 'lib/iso4217/currency.rb', line 5

def initialize(code, sign, name)
  @code, @sign, @name = code, utf8(sign), name
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/iso4217/currency.rb', line 3

def code
  @code
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/iso4217/currency.rb', line 3

def name
  @name
end

#signObject (readonly)

Returns the value of attribute sign.



3
4
5
# File 'lib/iso4217/currency.rb', line 3

def sign
  @sign
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/iso4217/currency.rb', line 9

def to_s
  "Code: #{@code} | Sign: #{@sign} | Currency: #{@name}"
end