Class: AbacatePay::Enums::Billings::Methods
- Inherits:
-
Object
- Object
- AbacatePay::Enums::Billings::Methods
- Defined in:
- lib/abacate_pay/enums/billings/methods.rb
Overview
Enumeration defining billing methods.
This enumeration is used to represent different payment methods available for billing.
Constant Summary collapse
- PIX =
PIX payment method.
"PIX"- CARD =
"CARD"
Class Method Summary collapse
-
.valid?(value) ⇒ Boolean
Validates if a given value is a valid method.
-
.validate!(value) ⇒ String
Validates and returns the value if valid.
-
.values ⇒ Array<String>
Gets all valid method values.
Class Method Details
.valid?(value) ⇒ Boolean
Validates if a given value is a valid method
24 25 26 |
# File 'lib/abacate_pay/enums/billings/methods.rb', line 24 def self.valid?(value) values.include?(value) end |
.validate!(value) ⇒ String
Validates and returns the value if valid
32 33 34 35 36 |
# File 'lib/abacate_pay/enums/billings/methods.rb', line 32 def self.validate!(value) raise ArgumentError, "Invalid payment method: #{value}" unless valid?(value) value end |