Class: Motionscan::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/motionscan/result.rb

Instance Method Summary collapse

Constructor Details

#initialize(msSDKResult) ⇒ Result

Returns a new instance of Result.



5
6
7
# File 'lib/motionscan/result.rb', line 5

def initialize(msSDKResult)
  @msSDKResult = msSDKResult
end

Instance Method Details

#dataObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/motionscan/result.rb', line 13

def data
  error_ptr = Pointer.new(:object)

  options = NSJSONReadingMutableContainers | NSJSONReadingMutableLeaves | NSJSONReadingAllowFragments
  json = NSJSONSerialization.JSONObjectWithData(base64URLString,
    options:options,
    error:error_ptr)

  error = error_ptr[0]
  error.nil? ? json : decodeImageBase64URLString
end

#imageIdObject



9
10
11
# File 'lib/motionscan/result.rb', line 9

def imageId
  @msSDKResult.getValue
end