How to return entire row to compare against another row in ruby

B

bww00amdahl

New to Ruby and would like to the following in Ruby

Read row
save the entire row (maybe zip it).

process.....


Receive user changes.

reread the row for update
compare the row to the saved row for changes
if no changes update the row
if changes error message to user, info has changed.

Thanks for your help

Bryan Webb
 
J

James Edward Gray II

New to Ruby and would like to the following in Ruby

Read row
save the entire row (maybe zip it).

process.....


Receive user changes.

reread the row for update
compare the row to the saved row for changes
if no changes update the row
if changes error message to user, info has changed.

Thanks for your help

Not sure I understand the question. A "row" of what? Database table
date, chess board pieces, pixels, or something else?

Also, what have you tried? Where are you running into difficulties?

James Edward Gray II
 
J

James Edward Gray II

Yes, database row.
just starting on design.

You still haven't asked a question, that I can see. Are you asking
me to write it for you, or is there some problem you need help with?

James Edward Gray II
 
D

Devin Mullins

Yes, database row.
just starting on design.

Thanks
There are lots of database APIs for Ruby out there. Are you looking for
some links?

As far as serialization goes, there's a Marshal class in the Ruby
stdlibs, but you're welcome to implement your own. You could also write
to YAML, or use a lib like AMarshal to store the Ruby object itself:

http://redhanded.hobix.com/inspect/serializingToRubyCode.html

I just googled for "Ruby marshal" to find that. Looks pretty neat.

Devin
Light a fire for a man, and he's warm for the night.
Set a man on fire, and he's warm for the rest of his life.
 
B

bww00amdahl

Thanks,
I have done this in other languages and was looking for some direction,
or if it had been done in ruby before ,,, the ruby code.

Bryan
 
J

James Edward Gray II

Thanks,
I have done this in other languages and was looking for some
direction,
or if it had been done in ruby before ,,, the ruby code.

Well, you should probably examine the DBI for the database work.
Comparing rows is a trivial programming task. You mentioned user
input, I think a library like HighLine makes that a lot easier.

Hope that gets you going. Feel free to ask questions if you get
stuck...

James Edward Gray II
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top