Class: AdvancedBilling::IncludeNotNull
- Inherits:
-
Object
- Object
- AdvancedBilling::IncludeNotNull
- Defined in:
- lib/advanced_billing/models/include_not_null.rb
Overview
Passed as a parameter to list methods to return only non null values.
Constant Summary collapse
- INCLUDE_NOT_NULL =
[ # TODO: Write general description for NOT_NULL NOT_NULL = 'not_null'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = NOT_NULL) ⇒ Object
20 21 22 23 24 |
# File 'lib/advanced_billing/models/include_not_null.rb', line 20 def self.from_value(value, default_value = NOT_NULL) return default_value if value.nil? default_value end |
.validate(value) ⇒ Object
14 15 16 17 18 |
# File 'lib/advanced_billing/models/include_not_null.rb', line 14 def self.validate(value) return false if value.nil? INCLUDE_NOT_NULL.include?(value) end |