Class: AbacatePay::Enums::Billing::Methods
- Inherits:
-
Object
- Object
- AbacatePay::Enums::Billing::Methods
- Defined in:
- lib/abacatepay/enums/billing/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"
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
23 24 25 |
# File 'lib/abacatepay/enums/billing/methods.rb', line 23 def self.valid?(value) values.include?(value) end |
.validate!(value) ⇒ String
Validates and returns the value if valid
31 32 33 34 |
# File 'lib/abacatepay/enums/billing/methods.rb', line 31 def self.validate!(value) raise ArgumentError, "Invalid payment method: #{value}" unless valid?(value) value end |
.values ⇒ Array<String>
Gets all valid method values
16 17 18 |
# File 'lib/abacatepay/enums/billing/methods.rb', line 16 def self.values [PIX] end |