Class: OrbitMembers::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/orbit_members/utils.rb

Class Method Summary collapse

Class Method Details

.valid_json?(string) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
# File 'lib/orbit_members/utils.rb', line 5

def self.valid_json?(string)
  !JSON.parse(string).nil?
rescue JSON::ParserError
  raise ArgumentError,
        "Expected confirmation from the Orbit API, but received nothing. Please check your logs and try again."
end