Module: Decidim::ApiResponseHelper

Included in:
Proposals::ProposalMutationType
Defined in:
decidim-core/lib/decidim/api_response_helper.rb

Instance Method Summary collapse

Instance Method Details

#json_value(value) ⇒ Object

When passing the JSON types as a variables, it results to a string type.



6
7
8
9
10
# File 'decidim-core/lib/decidim/api_response_helper.rb', line 6

def json_value(value)
  return JSON.parse(value) if value.is_a?(String)

  value
end