Class: ThePlaidApi::AddressPurposeLabel
- Inherits:
-
Object
- Object
- ThePlaidApi::AddressPurposeLabel
- Defined in:
- lib/the_plaid_api/models/address_purpose_label.rb
Overview
Field describing whether the associated address is being used for commercial or residential purposes. Note: This value will be ‘no_data` when Plaid does not have sufficient data to determine the address’s use.
Constant Summary collapse
- ADDRESS_PURPOSE_LABEL =
[ # TODO: Write general description for RESIDENTIAL RESIDENTIAL = 'residential'.freeze, # TODO: Write general description for COMMERCIAL COMMERCIAL = 'commercial'.freeze, # TODO: Write general description for NO_DATA NO_DATA = 'no_data'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = RESIDENTIAL) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/the_plaid_api/models/address_purpose_label.rb', line 28 def self.from_value(value, default_value = RESIDENTIAL) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'residential' then RESIDENTIAL when 'commercial' then COMMERCIAL when 'no_data' then NO_DATA else default_value end end |
.validate(value) ⇒ Object
22 23 24 25 26 |
# File 'lib/the_plaid_api/models/address_purpose_label.rb', line 22 def self.validate(value) return false if value.nil? ADDRESS_PURPOSE_LABEL.include?(value) end |