Class: Yoti::DocScan::Support::SupportedCountry
- Inherits:
-
Object
- Object
- Yoti::DocScan::Support::SupportedCountry
- Defined in:
- lib/yoti/doc_scan/support/supported_documents.rb
Instance Attribute Summary collapse
- #code ⇒ String readonly
- #supported_documents ⇒ Array<SupportedDocument> readonly
Instance Method Summary collapse
-
#initialize(country) ⇒ SupportedCountry
constructor
A new instance of SupportedCountry.
Constructor Details
#initialize(country) ⇒ SupportedCountry
Returns a new instance of SupportedCountry.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/yoti/doc_scan/support/supported_documents.rb', line 33 def initialize(country) Validation.assert_is_a(String, country['code'], 'code', true) @code = country['code'] if country['supported_documents'].nil? @supported_documents = [] else Validation.assert_is_a(Array, country['supported_documents'], 'supported_documents') @supported_documents = country['supported_documents'].map { |document| SupportedDocument.new(document) } end end |
Instance Attribute Details
#code ⇒ String (readonly)
25 26 27 |
# File 'lib/yoti/doc_scan/support/supported_documents.rb', line 25 def code @code end |
#supported_documents ⇒ Array<SupportedDocument> (readonly)
28 29 30 |
# File 'lib/yoti/doc_scan/support/supported_documents.rb', line 28 def supported_documents @supported_documents end |