First session notes

2 views
Skip to first unread message

Yasmine

unread,
Oct 30, 2011, 2:50:37 PM10/30/11
to LearnRuby101
Thanks to everyone who braved the elements yesterday. We had a good
turnout at 10. My notes for those who missed it are below - feel free
to respond with any questions. If I can't help, I'm sure someone else
can.

We used https://github.com/edgecase/ruby_koans as a guide to practice
what we learned. Download the zipped file, open them up one by one on
a text editor as specified and follow the instructions in the
comments. Then run the command “rake” to see how you did.

Intro:
•Rails – platform, code written in Ruby that runs in open source.
Gives you methods to expose your code.
•Ruby – core language and library. Can run in other platforms other
than Rails.
•Gems – packets of functionality. Similar to plugins in WordPress.
•Think of Ruby as the ingredients and Rails as the cake.
•Others: PHP/CakePHP, Python/Django, .Net/MVC…

Ruby:
•Can easily change classes and re-define them in comparison to other
languages
•In Ruby, everything is an Object
•Objects are methods that you can call that do things
•Classes are objects in Ruby
•Lasagna example: The recipe is the class, when you make it and it’s
on the plate, it’s an instance.
•Instance = object
•Class is a blueprint and an object is what you build from a blueprint
•Use .new to create an instance of a class
•“p” is a shortcut for “puts string”
•Can use double quotes or single quotes for strings
•Type “public_methods” to see the methods for the instances of that
Object
•A string is a set of characters the computer can process. Imagine the
letters are on a string of laundry line and the quotes are clothespins
holding the ends. The quotes mark the beginning and end.

A big thanks to Len again for leading our session. Information on our
second meetup is coming soon!

Michael Reichner

unread,
Oct 30, 2011, 9:54:38 PM10/30/11
to learnr...@googlegroups.com
If I may offer a couple of clarifications:


•Rails – platform, code written in Ruby that runs in open source. Gives you methods to expose your code.
•Ruby – core language and library. Can run in other platforms other than Rails.

Rails is an open source web application framework (WAF), written in Ruby.  It lets you develop web sites more quickly by providing already developed and tested functionality that you will likely need to include in your site.

There are several other WAFs written in Ruby, and you could develop your own framework if you wanted to do so.  That said, Rails is the most commonly used.


•Objects are methods that you can call that do things

Objects have methods that you can call that do things.  You can see which methods are available for a given object by invoking the public_methods method on the object:

irb(main):027:0> object_name.public_methods
--
Great minds discuss ideas; average minds discuss events; small minds discuss people.

Christopher Imbriano

unread,
Oct 31, 2011, 12:44:02 PM10/31/11
to learnr...@googlegroups.com
Ruby Koans is a really great resource.

I'll add that the online book Learn Ruby the Hard Way is also a good beginners' resource.  http://ruby.learncodethehardway.org/book/

Yasmine

unread,
Nov 2, 2011, 3:06:57 PM11/2/11
to LearnRuby101
Thank you both for the clarifications and resources. They're very
helpful!

On Oct 31, 12:44 pm, Christopher Imbriano
Reply all
Reply to author
Forward
0 new messages