Class: AdvancedBilling::CreditType

Inherits:
Object
  • Object
show all
Defined in:
lib/advanced_billing/models/credit_type.rb

Overview

The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.

Constant Summary collapse

CREDIT_TYPE =
[
  # TODO: Write general description for FULL
  FULL = 'full'.freeze,

  # TODO: Write general description for PRORATED
  PRORATED = 'prorated'.freeze,

  # TODO: Write general description for NONE
  NONE = 'none'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.validate(value) ⇒ Object



22
23
24
25
26
# File 'lib/advanced_billing/models/credit_type.rb', line 22

def self.validate(value)
  return false if value.nil?

  CREDIT_TYPE.include?(value)
end