Module: Kaui::PaymentMethodHelper

Defined in:
app/helpers/kaui/payment_method_helper.rb

Instance Method Summary collapse

Instance Method Details

#is_json?(value) ⇒ Boolean

Returns:

  • (Boolean)

4
5
6
7
8
9
# File 'app/helpers/kaui/payment_method_helper.rb', line 4

def is_json?(value)
  result = JSON.parse(value)
  result.is_a?(Hash) || result.is_a?(Array)
rescue JSON::ParserError, TypeError
  false
end