Class: Dolla::ReferenceNumber

Inherits:
Object
  • Object
show all
Defined in:
lib/dolla/reference_number.rb

Constant Summary collapse

REFERENCE_NUMBER_FORMAT =
{ initial: '%07d%s%d%d', final: '%s-%02d' }.freeze
BANK_FILLER =
%w/11 13 17 19 23/.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payment_id:, due_date:, amount:) ⇒ ReferenceNumber

Returns a new instance of ReferenceNumber.



11
12
13
14
15
# File 'lib/dolla/reference_number.rb', line 11

def initialize(payment_id:, due_date:, amount:)
  @id = payment_id
  @due_date = due_date
  @amount = amount
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



4
5
6
# File 'lib/dolla/reference_number.rb', line 4

def amount
  @amount
end

#due_dateObject (readonly)

Returns the value of attribute due_date.



4
5
6
# File 'lib/dolla/reference_number.rb', line 4

def due_date
  @due_date
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/dolla/reference_number.rb', line 4

def id
  @id
end

#requestObject (readonly)

Returns the value of attribute request.



4
5
6
# File 'lib/dolla/reference_number.rb', line 4

def request
  @request
end

Instance Method Details

#numberObject



17
18
19
# File 'lib/dolla/reference_number.rb', line 17

def number
  final_reference_number_format % [ref, ref_hash]
end