Class: PaypalServerSdk::PricingModel
- Inherits:
-
Object
- Object
- PaypalServerSdk::PricingModel
- Defined in:
- lib/paypal_server_sdk/models/pricing_model.rb
Overview
The pricing model for the billing cycle.
Constant Summary collapse
- PRICING_MODEL =
[ # A fixed pricing scheme where the customer is charged a fixed amount. FIXED = 'FIXED'.freeze, # A variable pricing scheme where the customer is charged a variable # amount. VARIABLE = 'VARIABLE'.freeze, # A auto-reload pricing scheme where the customer is charged a fixed # amount for reload. AUTO_RELOAD = 'AUTO_RELOAD'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = FIXED) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/paypal_server_sdk/models/pricing_model.rb', line 28 def self.from_value(value, default_value = FIXED) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'fixed' then FIXED when 'variable' then VARIABLE when 'auto_reload' then AUTO_RELOAD else default_value end end |
.validate(value) ⇒ Object
22 23 24 25 26 |
# File 'lib/paypal_server_sdk/models/pricing_model.rb', line 22 def self.validate(value) return false if value.nil? true end |