Module: Transcriptic::Helpers
Instance Method Summary collapse
- #json_decode(json) ⇒ Object
- #json_encode(object) ⇒ Object
- #running_on_a_mac? ⇒ Boolean
- #running_on_windows? ⇒ Boolean
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
8 9 10 |
# File 'lib/transcriptic/helpers.rb', line 8 def running_on_a_mac? RUBY_PLATFORM =~ /-darwin\d/ end |
#running_on_windows? ⇒ Boolean
4 5 6 |
# File 'lib/transcriptic/helpers.rb', line 4 def running_on_windows? RUBY_PLATFORM =~ /mswin32|mingw32/ end |