lib/yoti/doc_scan/session/retrieve/page_response.rb in yoti-1.9.0 vs lib/yoti/doc_scan/session/retrieve/page_response.rb in yoti-1.10.0

- old
+ new

@@ -9,17 +9,27 @@ attr_reader :capture_method # @return [MediaResponse] attr_reader :media + # @return [Array<FrameResponse>] + attr_reader :frames + # # @param [Hash] page # def initialize(page) Validation.assert_is_a(String, page['capture_method'], 'capture_method', true) @capture_method = page['capture_method'] @media = MediaResponse.new(page['media']) unless page['media'].nil? + + if page['frames'].nil? + @frames = [] + else + Validation.assert_is_a(Array, page['frames'], 'frames') + @frames = page['frames'].map { |frame| FrameResponse.new(frame) } + end end end end end end