Sha256: 21b5abe696e91e722430f8130b92fc0e87b7c77885bcac92bfe8113dc77bcf69

Contents?: true

Size: 244 Bytes

Versions: 4

Compression:

Stored size: 244 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kaui-3.0.4 app/helpers/kaui/payment_method_helper.rb
kaui-3.0.2 app/helpers/kaui/payment_method_helper.rb
kaui-2.2.1 app/helpers/kaui/payment_method_helper.rb
kaui-3.0.1 app/helpers/kaui/payment_method_helper.rb