Module: Glib::Json::Transformation

Defined in:
app/controllers/concerns/glib/json/transformation.rb

Instance Method Summary collapse

Instance Method Details

#__json_transformation_commitObject



8
9
10
# File 'app/controllers/concerns/glib/json/transformation.rb', line 8

def __json_transformation_commit
  response.body = @__transformed_json.to_json if @__transformed_json
end

#json_transformation_startObject



2
3
4
5
6
# File 'app/controllers/concerns/glib/json/transformation.rb', line 2

def json_transformation_start
  if request.format == 'json'
    @__transformed_json ||= JSON.parse(response.body) rescue nil
  end
end