diff --git a/lib/pastebinner.rb b/lib/pastebinner.rb index 5b35206..14b3445 100755 --- a/lib/pastebinner.rb +++ b/lib/pastebinner.rb @@ -127,8 +127,14 @@ class Pastebinner end def encode_json(raw_paste_text) - # add in a method here that will add serialize the raw paste data in json, and add in two keys i think should be good enough to send off to a db? - # full_text: text, #paste_key_name: paste_key + # raw_paste_text should be a RestClient response.body or a string + time = Time.new + hashed_data = + { + "date": time.strftime("%Y-%m-%d %H:%M:%S"), + "text": raw_paste_text + } + hashed_data.to_json end # keep this method private so we are not letting anyone run any method in our program