Class: EVSS::PPIU::PaymentAccount
- Inherits:
-
Object
- Object
- EVSS::PPIU::PaymentAccount
- Includes:
- ActiveModel::Serialization, ActiveModel::Validations
- Defined in:
- lib/evss/ppiu/payment_account.rb
Overview
Model for a user’s payment account
Constant Summary collapse
- ACCOUNT_NUM_REGEX =
/\A\d*\z/
- ROUTING_NUM_REGEX =
/\A\d{9}\z/
Instance Attribute Summary collapse
-
#account_number ⇒ String
The account number; digits only.
-
#account_type ⇒ String
The type of account, i.e.
-
#financial_institution_name ⇒ String
The name of the financial institution.
-
#financial_institution_routing_number ⇒ String
The routing number of the financial institution; exactly 9 digits.
Instance Attribute Details
#account_number ⇒ String
Returns The account number; digits only.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/evss/ppiu/payment_account.rb', line 19 class PaymentAccount include Virtus.model include ActiveModel::Validations include ActiveModel::Serialization ACCOUNT_NUM_REGEX = /\A\d*\z/ ROUTING_NUM_REGEX = /\A\d{9}\z/ attribute :account_type, String attribute :financial_institution_name, String attribute :account_number, String attribute :financial_institution_routing_number, String validates :account_type, inclusion: { in: %w[Checking Savings] }, presence: true validates :account_number, presence: true validates :financial_institution_routing_number, presence: true validates_format_of :account_number, with: ACCOUNT_NUM_REGEX validates_format_of :financial_institution_routing_number, with: ROUTING_NUM_REGEX end |
#account_type ⇒ String
Returns The type of account, i.e. “Checking” or “Savings”.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/evss/ppiu/payment_account.rb', line 19 class PaymentAccount include Virtus.model include ActiveModel::Validations include ActiveModel::Serialization ACCOUNT_NUM_REGEX = /\A\d*\z/ ROUTING_NUM_REGEX = /\A\d{9}\z/ attribute :account_type, String attribute :financial_institution_name, String attribute :account_number, String attribute :financial_institution_routing_number, String validates :account_type, inclusion: { in: %w[Checking Savings] }, presence: true validates :account_number, presence: true validates :financial_institution_routing_number, presence: true validates_format_of :account_number, with: ACCOUNT_NUM_REGEX validates_format_of :financial_institution_routing_number, with: ROUTING_NUM_REGEX end |
#financial_institution_name ⇒ String
Returns The name of the financial institution.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/evss/ppiu/payment_account.rb', line 19 class PaymentAccount include Virtus.model include ActiveModel::Validations include ActiveModel::Serialization ACCOUNT_NUM_REGEX = /\A\d*\z/ ROUTING_NUM_REGEX = /\A\d{9}\z/ attribute :account_type, String attribute :financial_institution_name, String attribute :account_number, String attribute :financial_institution_routing_number, String validates :account_type, inclusion: { in: %w[Checking Savings] }, presence: true validates :account_number, presence: true validates :financial_institution_routing_number, presence: true validates_format_of :account_number, with: ACCOUNT_NUM_REGEX validates_format_of :financial_institution_routing_number, with: ROUTING_NUM_REGEX end |
#financial_institution_routing_number ⇒ String
Returns The routing number of the financial institution; exactly 9 digits.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/evss/ppiu/payment_account.rb', line 19 class PaymentAccount include Virtus.model include ActiveModel::Validations include ActiveModel::Serialization ACCOUNT_NUM_REGEX = /\A\d*\z/ ROUTING_NUM_REGEX = /\A\d{9}\z/ attribute :account_type, String attribute :financial_institution_name, String attribute :account_number, String attribute :financial_institution_routing_number, String validates :account_type, inclusion: { in: %w[Checking Savings] }, presence: true validates :account_number, presence: true validates :financial_institution_routing_number, presence: true validates_format_of :account_number, with: ACCOUNT_NUM_REGEX validates_format_of :financial_institution_routing_number, with: ROUTING_NUM_REGEX end |