This forum is in archive mode. You will not be able to post new content.

Author Topic: [Ruby] - Experience with Classes  (Read 416 times)

0 Members and 1 Guest are viewing this topic.

Offline JpzhD

  • NULL
  • Posts: 1
  • Cookies: 0
    • View Profile
[Ruby] - Experience with Classes
« on: March 17, 2014, 08:58:12 PM »
Hello,


I'm new to this website and whilst it may be wrong of me to immediately start asking questions rather than helping someone,  I am still going to do it. I have been learning ruby for quite a while now and I like to believe that I am fairly proficient (e.g. I'm not a complete noob). I have read a few books and wrote some scripts of my own, but a problem I am having is that I do not know when I should use classes in my script and why I should use classes.


I do not want to be a 'help vampire' by asking questions without contributing to the community but at this moment this is something I am having a real problem with.

If there is anyone out there who would be willing to spend some time to explain to me why I should use classes and when, I would be very appreciative. If there is also someone out there who could provide me with a code template or something similar so I can get some practice in, I would be even more thankful.

Thank you in advance,
JpzhD

Offline Phage

  • VIP
  • Overlord
  • *
  • Posts: 1280
  • Cookies: 120
    • View Profile
Re: [Ruby] - Experience with Classes
« Reply #1 on: March 17, 2014, 10:01:48 PM »
There's nothing wrong in asking questions. But maybe you should make an introduction, so we know who were are helping ;)

I can't give you specific Ruby examples, but I'll advise you to visit and read this link: https://www.inkling.com/read/learning-python-mark-lutz-4th/chapter-25/why-use-classes

"Ruby devs do, in fact, get all the girls. No girl wants a python, but EVERY girl wants rubies" - connection

"It always takes longer than you expect, even when you take into account Hofstadter’s Law."

 



Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.