DEV Community

Discussion on: Ruby classes seem pretty cool

Collapse
 
gumatias profile image
Gustavo Matias • Edited

All good :)

What role does Ruby classes play in handling Api creation?

In our context, a Ruby class is one of the prerequisites to create an API

What role does Ruby classes play in handling Api requests?

The request comes as plain text. But then it gets transformed into an object that is made of a Ruby class. Like a Hash for example.

You mentioned classes and handling requests. So here's what I think this means in practice in Ruby on Rails: ActionDispatch::Http::Request.

The mechanics of it uses Controllers in Rails case. Assuming that's what you're learning. I recommend a read at Rails guides for further clarification.

Thread Thread
 
danielarmbruster0314 profile image
danielarmbruster0314

This is exactly what I was looking for thank you.