68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/vchain_client.rb', line 68
def self.cut(arr)
arr.each { |k, v|
if arr["type"] == FIELD_TYPE_TRAVEL_DOCUMENT_HASHED
if k == "type" || k == "country_code" || k == "number" || k == "surname" || k == "given_names" || k == "birthdate" || k == "nationality" || k == "sex" || k == "birthplace" || k == "issue_date" || k == "expiry_date" || k == "authority"
arr[k] = v
else
arr.delete(k)
end
elsif arr["type"] == FIELD_TYPE_TEST_DOCUMENT_HASHED
if k == "type" || k == "a" || k == "b" || k == "c" || k == "d" || k == "e"
arr[k] = v
else
arr.delete(k)
end
end
}
end
|