Module: Identisure::Vipps::Status

Defined in:
lib/identisure/vipps.rb

Class Method Summary collapse

Class Method Details

.from_json(d) ⇒ Object



115
116
117
118
119
120
121
122
123
# File 'lib/identisure/vipps.rb', line 115

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 vipps status: #{d['status'].inspect}")
  end
end