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.



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

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.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def agentname
  @agentname
end

#company_idObject

Returns the value of attribute company_id.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def company_id
  @company_id
end

#filenameObject

Returns the value of attribute filename.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def filename
  @filename
end

#hrefObject

Returns the value of attribute href.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def href
  @href
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def id
  @id
end

#identification_timeObject

Returns the value of attribute identification_time.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def identification_time
  @identification_time
end

#reasonObject

Returns the value of attribute reason.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def reason
  @reason
end

#resultObject

Returns the value of attribute result.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def result
  @result
end

#transaction_numberObject

Returns the value of attribute transaction_number.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def transaction_number
  @transaction_number
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/idnow/models/identification_process.rb', line 6

def type
  @type
end

Instance Method Details

#review_pending?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/idnow/models/identification_process.rb', line 25

def review_pending?
  result == 'REVIEW_PENDING'
end

#successful?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/idnow/models/identification_process.rb', line 21

def successful?
  SUCCESSFUL_RESPONSES.include?(result)
end