Class: GnuCash::Invoice::Currency

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#mnemonicObject (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

#rawObject (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