lib/ps_utilities/pre_built_post.rb
def u_studentsuserfields(data)
      db_extensions = { "name"=>"u_studentsuserfields", "recordFound"=>false,
                        "_field"=> [] }
      data.each do |key, value|
        db_extensions["_field"] << {"name"=>"#{key}", "type"=>"String", "value"=>"#{value}"}
      end
      db_extensions
    end
# prepare data to built-in database extensions
# @param data [Hash] - with the format: {u_studentsuserfields: {field1: data1, field2: data2}}
# @return [Hash] - with data like below:
# { "name"=>"u_students_extension",
#   "recordFound"=>false,
#   "_field"=> [
#     {"name"=>"transcriptaddrzip", "type"=>"String", "value"=>75230},
#     {"name"=>"transcriptaddrcountry", "type"=>"String", "value"=>"United States"},
#     {"name"=>"transcriptaddrcity", "type"=>"String", "value"=>"dallas"},
#     {"name"=>"transcriptaddrstate", "type"=>"String", "value"=>"Texas"},
#     {"name"=>"transcriptaddrline1", "type"=>"String", "value"=>"6138 meadow rd"}
#   ]
# }
prepare data to built-in database extensions
prepare data to built - in database extensions
def u_studentsuserfields(data)
      db_extensions = { "name"=>"u_studentsuserfields", "recordFound"=>false,
                        "_field"=> [] }
      data.each do |key, value|
        db_extensions["_field"] << {"name"=>"#{key}", "type"=>"String", "value"=>"#{value}"}
      end
      db_extensions
    end
def u_studentsuserfields ( data ) db_extensions = { "name" => "u_studentsuserfields" , "recordFound" => false , "_field" => [ ] } data . each do | key , value | db_extensions [ "_field" ] << { "name" => "#{key}" , "type" => "String" , "value" => "#{value}" } end db_extensions end
prepare data to built-in database extensions
prepare data to built - in database extensions
with data like below: { "name"=>"u_students_extension", "recordFound"=>false, "_field"=> [ {"name"=>"transcriptaddrzip", "type"=>"String", "value"=>75230}, {"name"=>"transcriptaddrcountry", "type"=>"String", "value"=>"United States"}, {"name"=>"transcriptaddrcity", "type"=>"String", "value"=>"dallas"}, {"name"=>"transcriptaddrstate", "type"=>"String", "value"=>"Texas"}, {"name"=>"transcriptaddrline1", "type"=>"String", "value"=>"6138 meadow rd"} ] }
with data like below : { " name " = > " u_students_extension " " recordFound " = > false " _field " = > [ { " name " = > " transcriptaddrzip " " type " = > " String " " value " = > 75230 } { " name " = > " transcriptaddrcountry " " type " = > " String " " value " = > " United States " } { " name " = > " transcriptaddrcity " " type " = > " String " " value " = > " dallas " } { " name " = > " transcriptaddrstate " " type " = > " String " " value " = > " Texas " } { " name " = > " transcriptaddrline1 " " type " = > " String " " value " = > " 6138 meadow rd " } ] }
Hash
data
with the format: {u_studentsuserfields: {field1: data1, field2: data2}}
with the format : { u_studentsuserfields : { field1 : data1 field2 : data2 }}