Class: AbacatePay::Enums::Billings::Frequencies
- Inherits:
-
Object
- Object
- AbacatePay::Enums::Billings::Frequencies
- Defined in:
- lib/abacate_pay/enums/billings/frequencies.rb
Overview
Enumeration defining billing frequencies.
This enumeration is used to categorize different payment or billing frequencies.
Constant Summary collapse
- ONE_TIME =
One-time billing.
"ONE_TIME"- WEEKLY =
"WEEKLY"- MONTHLY =
"MONTHLY"- SEMIANNUALLY =
"SEMIANNUALLY"- ANNUALLY =
"ANNUALLY"- MULTIPLE_PAYMENTS =
"MULTIPLE_PAYMENTS"
Class Method Summary collapse
-
.valid?(value) ⇒ Boolean
Validates if a given value is a valid frequency.
-
.validate!(value) ⇒ String
Validates and returns the value if valid.
-
.values ⇒ Array<String>
Gets all valid frequency values.
Class Method Details
.valid?(value) ⇒ Boolean
Validates if a given value is a valid frequency
28 29 30 |
# File 'lib/abacate_pay/enums/billings/frequencies.rb', line 28 def self.valid?(value) values.include?(value) end |
.validate!(value) ⇒ String
Validates and returns the value if valid
36 37 38 39 40 |
# File 'lib/abacate_pay/enums/billings/frequencies.rb', line 36 def self.validate!(value) raise ArgumentError, "Invalid frequency: #{value}" unless valid?(value) value end |
.values ⇒ Array<String>
Gets all valid frequency values
21 22 23 |
# File 'lib/abacate_pay/enums/billings/frequencies.rb', line 21 def self.values [ONE_TIME, WEEKLY, MONTHLY, SEMIANNUALLY, ANNUALLY, MULTIPLE_PAYMENTS] end |