module StringExtensions
Module for safely include methods in String built-in class
Public Instance Methods
valid_json?()
click to toggle source
Verifies if the string is a valid JSON format If valid, returns true; otherwise false
# File lib/boechat/internal/string_extensions.rb, line 8 def valid_json? JSON.parse(self) true rescue JSON::ParserError false end