Class: Veriff::Webhooks::Decision

Inherits:
Model
  • Object
show all
Extended by:
Veriff::Webhook
Defined in:
lib/veriff/webhooks/decision.rb

Instance Method Summary collapse

Methods included from Veriff::Webhook

parse

Methods inherited from Model

api_collection_name, #method_missing, #respond_to_missing?

Constructor Details

#initialize(body) ⇒ Decision

Returns a new instance of Decision.



8
9
10
# File 'lib/veriff/webhooks/decision.rb', line 8

def initialize(body)
  super(Parser.call(body, :json)[:verification])
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Veriff::Model

Instance Method Details

#documentObject



16
17
18
# File 'lib/veriff/webhooks/decision.rb', line 16

def document
  @document ||= OpenStruct.new(@data_hash[:document])
end

#personObject



12
13
14
# File 'lib/veriff/webhooks/decision.rb', line 12

def person
  @person ||= OpenStruct.new(@data_hash[:person])
end