Class: Simplepay::Support::Currency

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

Overview

Contains a name, recognized code, and basic formatting for a particular international monetary currency.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, code, format) ⇒ Currency

Returns a new instance of Currency.



11
12
13
# File 'lib/simplepay/support/currency.rb', line 11

def initialize(name, code, format)
  @name, @code, @format = name, code, format
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#formatObject (readonly)

Returns the value of attribute format.



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

def format
  @format
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/simplepay/support/currency.rb', line 15

def to_s
  "#{code}"
end