Class: Idnow::IdentificationProcess

Inherits:
Object
  • Object
show all
Includes:
Jsonable
Defined in:
lib/idnow/models/identification_process.rb

Constant Summary collapse

SUCCESSFUL_RESPONSES =
%w[SUCCESS SUCCESS_DATA_CHANGED].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Jsonable

#to_h, #to_json

Constructor Details

#initialize(data) ⇒ IdentificationProcess

Returns a new instance of IdentificationProcess.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/idnow/models/identification_process.rb', line 10

def initialize(data)
  @result              = data['result']
  @reason              = data['reason']
  @company_id          = data['companyid']
  @filename            = data['filename']
  @agentname           = data['agentname']
  @identification_time = data['identificationtime']
  @id                  = data['id']
  @href                = data['href']
  @type                = data['type']
  @transaction_number  = data['transactionnumber']
end

Instance Attribute Details

#agentnameObject

Returns the value of attribute agentname.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def agentname
  @agentname
end

#company_idObject

Returns the value of attribute company_id.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def company_id
  @company_id
end

#filenameObject

Returns the value of attribute filename.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def filename
  @filename
end

#hrefObject

Returns the value of attribute href.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def href
  @href
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def id
  @id
end

#identification_timeObject

Returns the value of attribute identification_time.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def identification_time
  @identification_time
end

#reasonObject

Returns the value of attribute reason.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def reason
  @reason
end

#resultObject

Returns the value of attribute result.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def result
  @result
end

#transaction_numberObject

Returns the value of attribute transaction_number.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def transaction_number
  @transaction_number
end

#typeObject

Returns the value of attribute type.



8
9
10
# File 'lib/idnow/models/identification_process.rb', line 8

def type
  @type
end

Instance Method Details

#review_pending?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/idnow/models/identification_process.rb', line 27

def review_pending?
  result == 'REVIEW_PENDING' || result == 'FRAUD_SUSPICION_PENDING'
end

#successful?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/idnow/models/identification_process.rb', line 23

def successful?
  SUCCESSFUL_RESPONSES.include?(result)
end