Class: Yoti::DocScan::Session::Create::RequiredDocument
- Inherits:
-
Object
- Object
- Yoti::DocScan::Session::Create::RequiredDocument
- Defined in:
- lib/yoti/doc_scan/session/create/required_document.rb
Direct Known Subclasses
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(type) ⇒ RequiredDocument
constructor
A new instance of RequiredDocument.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(type) ⇒ RequiredDocument
Returns a new instance of RequiredDocument.
11 12 13 14 15 16 |
# File 'lib/yoti/doc_scan/session/create/required_document.rb', line 11 def initialize(type) raise(TypeError, "#{self.class} cannot be instantiated") if self.class == RequiredDocument Validation.assert_is_a(String, type, 'type') @type = type end |
Instance Method Details
#as_json(*_args) ⇒ Object
22 23 24 25 26 |
# File 'lib/yoti/doc_scan/session/create/required_document.rb', line 22 def as_json(*_args) { type: @type } end |
#to_json(*_args) ⇒ Object
18 19 20 |
# File 'lib/yoti/doc_scan/session/create/required_document.rb', line 18 def to_json(*_args) as_json.to_json end |