module Transcriptic module Helpers def running_on_windows? RUBY_PLATFORM =~ /mswin32|mingw32/ end def running_on_a_mac? RUBY_PLATFORM =~ /-darwin\d/ end def json_encode(object) Transcriptic::OkJson.encode(object) rescue Transcriptic::OkJson::Error nil end def json_decode(json) Transcriptic::OkJson.decode(json) rescue Transcriptic::OkJson::Error nil end end end