Class: Veriff::Model
- Inherits:
-
Object
- Object
- Veriff::Model
- Defined in:
- lib/veriff/model.rb
Direct Known Subclasses
Attempt, Decision, Media, Person, Session, Timestamp, WatchlistScreening, Webhooks::Decision, Webhooks::Event, Webhooks::WatchlistScreening
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data_hash) ⇒ Model
constructor
A new instance of Model.
- #method_missing(method_name, *_args) ⇒ Object
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(data_hash) ⇒ Model
Returns a new instance of Model.
5 6 7 8 |
# File 'lib/veriff/model.rb', line 5 def initialize(data_hash) data_hash.fetch(:id) @data_hash = data_hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *_args) ⇒ Object
14 15 16 |
# File 'lib/veriff/model.rb', line 14 def method_missing(method_name, *_args) @data_hash.key?(method_name) ? @data_hash[method_name] : super end |
Class Method Details
.api_collection_name ⇒ Object
18 19 20 |
# File 'lib/veriff/model.rb', line 18 def self.api_collection_name "#{name.gsub('Veriff::', '').downcase}s" end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
10 11 12 |
# File 'lib/veriff/model.rb', line 10 def respond_to_missing?(method_name, include_private = false) @data_hash.key?(method_name) || super end |