Module: WebStub::JSON

Defined in:
lib/webstub/json.rb

Class Method Summary collapse

Class Method Details

.generate(hash) ⇒ Object



3
4
5
6
7
8
# File 'lib/webstub/json.rb', line 3

def self.generate(hash)
  error = Pointer.new(:object)
  result = NSJSONSerialization.dataWithJSONObject(hash, options:0, error:error)

  NSString.alloc.initWithData(result, encoding:NSUTF8StringEncoding)
end