Class: Virtuaaliviivakoodi::Generator
- Inherits:
-
Object
- Object
- Virtuaaliviivakoodi::Generator
- Defined in:
- lib/virtuaaliviivakoodi/generator.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#due_date ⇒ Object
readonly
Returns the value of attribute due_date.
-
#iban ⇒ Object
readonly
Returns the value of attribute iban.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(iban:, reference:, amount: nil, due_date: nil) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(iban:, reference:, amount: nil, due_date: nil) ⇒ Generator
Returns a new instance of Generator.
12 13 14 15 16 17 |
# File 'lib/virtuaaliviivakoodi/generator.rb', line 12 def initialize(iban:, reference:, amount: nil, due_date: nil) @iban = iban @reference = reference @amount = amount @due_date = due_date end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
10 11 12 |
# File 'lib/virtuaaliviivakoodi/generator.rb', line 10 def amount @amount end |
#due_date ⇒ Object (readonly)
Returns the value of attribute due_date.
10 11 12 |
# File 'lib/virtuaaliviivakoodi/generator.rb', line 10 def due_date @due_date end |
#iban ⇒ Object (readonly)
Returns the value of attribute iban.
10 11 12 |
# File 'lib/virtuaaliviivakoodi/generator.rb', line 10 def iban @iban end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
10 11 12 |
# File 'lib/virtuaaliviivakoodi/generator.rb', line 10 def reference @reference end |
Instance Method Details
#call ⇒ Object
19 20 21 |
# File 'lib/virtuaaliviivakoodi/generator.rb', line 19 def call reference_to_version + normalized_iban + normalized_amount + Virtuaaliviivakoodi.pad(normalized_reference, 23) + normalized_due_date end |