Module: Transcriptic::Helpers

Included in:
Auth, Client, Client
Defined in:
lib/transcriptic/helpers.rb

Instance Method Summary collapse

Instance Method Details

#json_decode(json) ⇒ Object



18
19
20
21
22
# File 'lib/transcriptic/helpers.rb', line 18

def json_decode(json)
  Transcriptic::OkJson.decode(json)
rescue Transcriptic::OkJson::Error
  nil
end

#json_encode(object) ⇒ Object



12
13
14
15
16
# File 'lib/transcriptic/helpers.rb', line 12

def json_encode(object)
  Transcriptic::OkJson.encode(object)
rescue Transcriptic::OkJson::Error
  nil
end

#running_on_a_mac?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/transcriptic/helpers.rb', line 8

def running_on_a_mac?
  RUBY_PLATFORM =~ /-darwin\d/
end

#running_on_windows?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/transcriptic/helpers.rb', line 4

def running_on_windows?
  RUBY_PLATFORM =~ /mswin32|mingw32/
end