Class: AdvancedBilling::ListPrepaymentDateField
- Inherits:
-
Object
- Object
- AdvancedBilling::ListPrepaymentDateField
- Defined in:
- lib/advanced_billing/models/list_prepayment_date_field.rb
Overview
List Prepayment Date Field.
Constant Summary collapse
- LIST_PREPAYMENT_DATE_FIELD =
[ # TODO: Write general description for CREATED_AT CREATED_AT = 'created_at'.freeze, # TODO: Write general description for APPLICATION_AT APPLICATION_AT = 'application_at'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = CREATED_AT) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/advanced_billing/models/list_prepayment_date_field.rb', line 23 def self.from_value(value, default_value = CREATED_AT) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'created_at' then CREATED_AT when 'application_at' then APPLICATION_AT else default_value end end |
.validate(value) ⇒ Object
17 18 19 20 21 |
# File 'lib/advanced_billing/models/list_prepayment_date_field.rb', line 17 def self.validate(value) return false if value.nil? LIST_PREPAYMENT_DATE_FIELD.include?(value) end |