Class: LockstepSdk::AgingModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/aging_model.rb

Overview

Represents an aging record

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ AgingModel

Initialize the AgingModel using the provided prototype



27
28
29
30
31
# File 'lib/lockstep_sdk/models/aging_model.rb', line 27

def initialize(params = {})
    @bucket = params.dig(:bucket)
    @currency_code = params.dig(:currency_code)
    @outstanding_balance = params.dig(:outstanding_balance)
end

Instance Attribute Details

#bucketInt32

Returns Aging bucket of outstanding balance data (days past due date of invoice).

Returns:

  • (Int32)

    Aging bucket of outstanding balance data (days past due date of invoice)



35
36
37
# File 'lib/lockstep_sdk/models/aging_model.rb', line 35

def bucket
  @bucket
end

#currency_codeString

Returns Currency code of aging bucket.

Returns:

  • (String)

    Currency code of aging bucket



39
40
41
# File 'lib/lockstep_sdk/models/aging_model.rb', line 39

def currency_code
  @currency_code
end

#outstanding_balanceDouble

Returns Outstanding balance for the given aging bucket.

Returns:

  • (Double)

    Outstanding balance for the given aging bucket



43
44
45
# File 'lib/lockstep_sdk/models/aging_model.rb', line 43

def outstanding_balance
  @outstanding_balance
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



47
48
49
50
51
52
53
# File 'lib/lockstep_sdk/models/aging_model.rb', line 47

def as_json(options={})
    {
        'bucket' => @bucket,
        'currencyCode' => @currency_code,
        'outstandingBalance' => @outstanding_balance,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



57
58
59
# File 'lib/lockstep_sdk/models/aging_model.rb', line 57

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end