get attributes from database

H

Hello Guy

Hello all,

i have a class Inpatient with his attributes like name, address, etc.

i want to catch the inpatient data from database, how i can do this?

i want add inpatients when i give the name, and so all attributes of
this
inpatient should come from database.

i hope i could define my prolem.

how can i implement this with ruby?

greet
 
J

Jesús Gabriel y Galán

Hello all,

i have a class Inpatient with his attributes like name, address, etc.

i want to catch the inpatient data from database, how i can do this?

i want add inpatients when i give the name, and so all attributes of
this
inpatient should come from database.

i hope i could define my prolem.

how can i implement this with ruby?

What you want is usually called ORM: Object-Relational Mapping, which
is a way to map data from a database into objects in a programming
language. In Ruby there are several implementations, you should check
some of them and choose one that suits your project. The most popular
ones (as perceived by me :) are ActiveRecord, Sequel and DataMapper.
You can use google to find documentation about those.

Hope this helps,

Jesus.
 
H

Hello Guy

Jesús Gabriel y Galán said:
What you want is usually called ORM: Object-Relational Mapping, which
is a way to map data from a database into objects in a programming
language. In Ruby there are several implementations, you should check
some of them and choose one that suits your project. The most popular
ones (as perceived by me :) are ActiveRecord, Sequel and DataMapper.
You can use google to find documentation about those.

Hope this helps,

Jesus.

thanks for your answer. i dont know if i have good defined my problem:
i have a separat program which calls inpatient.rb. and here is my class
inpatient, that should take data from database. is the mapping with orm
here right?
 

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

Forum statistics

Threads
473,774
Messages
2,569,600
Members
45,179
Latest member
pkhumanis73
Top