Class: GnuCash::Invoice::Currency
- Inherits:
-
Object
- Object
- GnuCash::Invoice::Currency
- Defined in:
- lib/gnucash/invoice/currency.rb
Instance Attribute Summary collapse
-
#mnemonic ⇒ Object
(also: #to_s)
readonly
Returns the value of attribute mnemonic.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Currency
constructor
A new instance of Currency.
Constructor Details
#initialize(data) ⇒ Currency
Returns a new instance of Currency.
8 9 10 11 12 |
# File 'lib/gnucash/invoice/currency.rb', line 8 def initialize data @raw = data @mnemonic = data[:mnemonic] end |
Instance Attribute Details
#mnemonic ⇒ Object (readonly) Also known as: to_s
Returns the value of attribute mnemonic.
5 6 7 |
# File 'lib/gnucash/invoice/currency.rb', line 5 def mnemonic @mnemonic end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/gnucash/invoice/currency.rb', line 5 def raw @raw end |
Class Method Details
.find(guid) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/gnucash/invoice/currency.rb', line 16 def self.find guid unless data = dataset.where(:guid => guid).first raise CurrencyNotFound, "GUID: #{guid}" end new(data) end |