Class: DTAUS::Konto
- Inherits:
-
Object
- Object
- DTAUS::Konto
- Defined in:
- lib/dtaus/konto.rb
Overview
Kontodaten verwalten mit Name des Inhabers und Bank, Bankleitzahl und Kontonummer.
Kundenkonto:
konto = Konto.new(kontonummer, bankleitzahl, inhaber, bankname, false, kundennummer)
oder einfach
konto = Konto.new(kontonummer, bankleitzahl, inhaber, bankname)
Auftraggeberkonto:
konto = Konto.new(kontonummer, bankleitzahl, inhaber, bankname, true)
Instance Attribute Summary collapse
-
#auftraggeber ⇒ Object
readonly
Returns the value of attribute auftraggeber.
-
#bank ⇒ Object
readonly
Returns the value of attribute bank.
-
#blz ⇒ Object
readonly
Returns the value of attribute blz.
-
#kunnr ⇒ Object
readonly
Returns the value of attribute kunnr.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nummer ⇒ Object
readonly
Returns the value of attribute nummer.
Instance Method Summary collapse
- #erweiterungen ⇒ Object
-
#initialize(_nummer, _blz, _name, _bank, _auftraggeber = false, _kunnr = 0) ⇒ Konto
constructor
A new instance of Konto.
Constructor Details
#initialize(_nummer, _blz, _name, _bank, _auftraggeber = false, _kunnr = 0) ⇒ Konto
Returns a new instance of Konto.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/dtaus/konto.rb', line 17 def initialize(_nummer, _blz, _name, _bank, _auftraggeber = false, _kunnr = 0) @auftraggeber = _auftraggeber @nummer = DTAUS.convert_number(_nummer) @blz = DTAUS.convert_number(_blz) @kunnr = DTAUS.convert_number(_kunnr) @name = DTAUS.convert_text(_name) @bank = DTAUS.convert_text(_bank) raise DTAUSException.new("Ungültige Kontonummer: #{nummer}") if nummer == 0 or nummer.to_s.size > 10 raise DTAUSException.new("Ungültige Bankleitzahl: #{blz}") if blz == 0 or blz.to_s.size > 8 end |
Instance Attribute Details
#auftraggeber ⇒ Object (readonly)
Returns the value of attribute auftraggeber.
15 16 17 |
# File 'lib/dtaus/konto.rb', line 15 def auftraggeber @auftraggeber end |
#bank ⇒ Object (readonly)
Returns the value of attribute bank.
15 16 17 |
# File 'lib/dtaus/konto.rb', line 15 def bank @bank end |
#blz ⇒ Object (readonly)
Returns the value of attribute blz.
15 16 17 |
# File 'lib/dtaus/konto.rb', line 15 def blz @blz end |
#kunnr ⇒ Object (readonly)
Returns the value of attribute kunnr.
15 16 17 |
# File 'lib/dtaus/konto.rb', line 15 def kunnr @kunnr end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/dtaus/konto.rb', line 15 def name @name end |
#nummer ⇒ Object (readonly)
Returns the value of attribute nummer.
15 16 17 |
# File 'lib/dtaus/konto.rb', line 15 def nummer @nummer end |
Instance Method Details
#erweiterungen ⇒ Object
30 31 32 |
# File 'lib/dtaus/konto.rb', line 30 def erweiterungen Erweiterung.from_string(auftraggeber ? :auftraggeber : :kunde, name) end |