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.1.7 config/initializers/json.rb
wordjelly-auth-1.1.6 config/initializers/json.rb
wordjelly-auth-1.1.5 config/initializers/json.rb
wordjelly-auth-1.1.4 config/initializers/json.rb
wordjelly-auth-1.1.3 config/initializers/json.rb
wordjelly-auth-1.1.2 config/initializers/json.rb
wordjelly-auth-1.1.1 config/initializers/json.rb
wordjelly-auth-1.1.0 config/initializers/json.rb
wordjelly-auth-1.0.9 config/initializers/json.rb
wordjelly-auth-1.0.8 config/initializers/json.rb
wordjelly-auth-1.0.5 config/initializers/json.rb
wordjelly-auth-1.0.4 config/initializers/json.rb
wordjelly-auth-1.0.3 config/initializers/json.rb
wordjelly-auth-1.0.2 config/initializers/json.rb
wordjelly-auth-0.0.8 config/initializers/json.rb
wordjelly-auth-0.0.5 config/initializers/json.rb
wordjelly-auth-0.0.4 config/initializers/json.rb
wordjelly-auth-0.0.3 config/initializers/json.rb
wordjelly-auth-0.0.1 config/initializers/json.rb