Module: Identisure::BankIdNo::Status

Defined in:
lib/identisure/bank_id_no.rb

Class Method Summary collapse

Class Method Details

.from_json(d) ⇒ Object



152
153
154
155
156
157
158
159
160
# File 'lib/identisure/bank_id_no.rb', line 152

def self.from_json(d)
  case d['status']
  when 'PENDING'   then Pending.from_json(d)
  when 'COMPLETED' then Completed.from_json(d)
  when 'FAILED'    then Failed.from_json(d)
  when String      then Unknown.new(status: d['status'])
  else raise IdentisureError.new(0, "Invalid bankid-no status: #{d['status'].inspect}")
  end
end