Sha256: 2866c1a5fe14a9cbda5808ad9d28f748613d670d7d4f1262e72c3d3a11f8e14d

Contents?: true

Size: 177 Bytes

Versions: 59

Compression:

Stored size: 177 Bytes

Contents

module JSON
  def self.is_json?(foo)
    begin
      return false unless foo.is_a?(String)
      JSON.parse(foo).all?
    rescue JSON::ParserError
      false
    end 
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 config/initializers/json.rb
wordjelly-auth-1.5.9 config/initializers/json.rb
wordjelly-auth-1.5.8 config/initializers/json.rb
wordjelly-auth-1.5.7 config/initializers/json.rb
wordjelly-auth-1.5.6 config/initializers/json.rb
wordjelly-auth-1.5.5 config/initializers/json.rb
wordjelly-auth-1.5.4 config/initializers/json.rb
wordjelly-auth-1.5.3 config/initializers/json.rb
wordjelly-auth-1.5.2 config/initializers/json.rb
wordjelly-auth-1.5.1 config/initializers/json.rb
wordjelly-auth-1.5.0 config/initializers/json.rb
wordjelly-auth-1.4.9 config/initializers/json.rb
wordjelly-auth-1.4.8 config/initializers/json.rb
wordjelly-auth-1.4.7 config/initializers/json.rb
wordjelly-auth-1.4.6 config/initializers/json.rb
wordjelly-auth-1.4.5 config/initializers/json.rb
wordjelly-auth-1.4.4 config/initializers/json.rb
wordjelly-auth-1.4.3 config/initializers/json.rb
wordjelly-auth-1.4.2 config/initializers/json.rb
wordjelly-auth-1.4.0 config/initializers/json.rb