Class: LockstepSdk::CashflowReportModel

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

Overview

Represents the cashflow report based on a timeframe

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CashflowReportModel

Initialize the CashflowReportModel using the provided prototype



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

def initialize(params = {})
    @timeframe = params.dig(:timeframe)
    @payments_collected = params.dig(:payments_collected)
    @payments_collected_count = params.dig(:payments_collected_count)
    @invoices_billed = params.dig(:invoices_billed)
    @invoices_billed_count = params.dig(:invoices_billed_count)
end

Instance Attribute Details

#invoices_billedDouble

Returns Amount of invoices billed based in the timeframe.

Returns:

  • (Double)

    Amount of invoices billed based in the timeframe



47
48
49
# File 'lib/lockstep_sdk/models/cashflow_report_model.rb', line 47

def invoices_billed
  @invoices_billed
end

#invoices_billed_countInt32

Returns Number of invoices billed in the timeframe.

Returns:

  • (Int32)

    Number of invoices billed in the timeframe



51
52
53
# File 'lib/lockstep_sdk/models/cashflow_report_model.rb', line 51

def invoices_billed_count
  @invoices_billed_count
end

#payments_collectedDouble

Returns Amount of payments collected based in the timeframe.

Returns:

  • (Double)

    Amount of payments collected based in the timeframe



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

def payments_collected
  @payments_collected
end

#payments_collected_countInt32

Returns Number of payments collected based in the timeframe.

Returns:

  • (Int32)

    Number of payments collected based in the timeframe



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

def payments_collected_count
  @payments_collected_count
end

#timeframeInt32

Returns Timeframe in days the cashflow report is generated on.

Returns:

  • (Int32)

    Timeframe in days the cashflow report is generated on



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

def timeframe
  @timeframe
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



55
56
57
58
59
60
61
62
63
# File 'lib/lockstep_sdk/models/cashflow_report_model.rb', line 55

def as_json(options={})
    {
        'timeframe' => @timeframe,
        'paymentsCollected' => @payments_collected,
        'paymentsCollectedCount' => @payments_collected_count,
        'invoicesBilled' => @invoices_billed,
        'invoicesBilledCount' => @invoices_billed_count,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



67
68
69
# File 'lib/lockstep_sdk/models/cashflow_report_model.rb', line 67

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