Class: ModernTreasury::Status7
- Inherits:
-
Object
- Object
- ModernTreasury::Status7
- Defined in:
- lib/modern_treasury/models/status7.rb
Overview
The status of the ledger account payout. It is set to ‘pending` by default. To post a ledger account payout at creation, use `posted`.
Constant Summary collapse
- STATUS7 =
[ # TODO: Write general description for PENDING PENDING = 'pending'.freeze, # TODO: Write general description for POSTED POSTED = 'posted'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = PENDING) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/modern_treasury/models/status7.rb', line 24 def self.from_value(value, default_value = PENDING) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'pending' then PENDING when 'posted' then POSTED else default_value end end |
.validate(value) ⇒ Object
18 19 20 21 22 |
# File 'lib/modern_treasury/models/status7.rb', line 18 def self.validate(value) return false if value.nil? STATUS7.include?(value) end |