Class: Osm::OnlinePayment::Schedule::Payment

Inherits:
Model
  • Object
show all
Defined in:
lib/osm/online_payment.rb,
lib/osm/online_payment.rb

Overview

Ensure the constant exists for the validators

Constant Summary

Constants inherited from Model

Model::SORT_BY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#<, #<=, #<=>, #>, #>=, #between?, #changed_attributes, configure, #reset_changed_attributes, #to_i

Constructor Details

#initializeObject

Initialize a new Payment

Parameters:

  • attributes (Hash)

    The hash of attributes (see attributes for descriptions, use Symbol of attribute name as the key)



# File 'lib/osm/online_payment.rb', line 272

Instance Attribute Details

#amountSreing

Returns the amount of the payment.

Returns:

  • (Sreing)

    the amount of the payment



253
# File 'lib/osm/online_payment.rb', line 253

attribute :id, type: Integer

#archivedBoolean

Returns whether the payment has been archived.

Returns:

  • (Boolean)

    whether the payment has been archived



253
# File 'lib/osm/online_payment.rb', line 253

attribute :id, type: Integer

#dateDate

Returns the payment’s due date.

Returns:

  • (Date)

    the payment’s due date



253
# File 'lib/osm/online_payment.rb', line 253

attribute :id, type: Integer

#idFixNum

Returns the payment’s ID.

Returns:

  • (FixNum)

    the payment’s ID



253
# File 'lib/osm/online_payment.rb', line 253

attribute :id, type: Integer

#nameString

Returns the name given to the payment.

Returns:

  • (String)

    the name given to the payment



253
# File 'lib/osm/online_payment.rb', line 253

attribute :id, type: Integer

#scheduleOsm::OnlnePayment::Schedule

Returns the schedule the payment belongs to.

Returns:

  • (Osm::OnlnePayment::Schedule)

    the schedule the payment belongs to



253
# File 'lib/osm/online_payment.rb', line 253

attribute :id, type: Integer

Instance Method Details

#inspectObject



284
285
286
# File 'lib/osm/online_payment.rb', line 284

def inspect
  Osm.inspect_instance(self, {:replace_with => {'schedule' => :to_s}})
end

#past_due?(date = Date.today) ⇒ Boolean

Check if the payment is past due (or will be past due on the passed date)

Parameters:

  • date (Date) (defaults to: Date.today)

    The date to check for (defaults to today)

Returns:

  • (Boolean)


280
281
282
# File 'lib/osm/online_payment.rb', line 280

def past_due?(date=Date.today)
  date > due_date
end