Class: ThePlaidApi::PaymentConsentPeriodicInterval
- Inherits:
-
Object
- Object
- ThePlaidApi::PaymentConsentPeriodicInterval
- Defined in:
- lib/the_plaid_api/models/payment_consent_periodic_interval.rb
Overview
Payment consent periodic interval.
Constant Summary collapse
- PAYMENT_CONSENT_PERIODIC_INTERVAL =
[ # TODO: Write general description for DAY DAY = 'DAY'.freeze, # TODO: Write general description for WEEK WEEK = 'WEEK'.freeze, # TODO: Write general description for MONTH MONTH = 'MONTH'.freeze, # TODO: Write general description for YEAR YEAR = 'YEAR'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = DAY) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/the_plaid_api/models/payment_consent_periodic_interval.rb', line 29 def self.from_value(value, default_value = DAY) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'day' then DAY when 'week' then WEEK when 'month' then MONTH when 'year' then YEAR else default_value end end |
.validate(value) ⇒ Object
23 24 25 26 27 |
# File 'lib/the_plaid_api/models/payment_consent_periodic_interval.rb', line 23 def self.validate(value) return false if value.nil? PAYMENT_CONSENT_PERIODIC_INTERVAL.include?(value) end |