recommended material to learn ruby [beginner]

1.Learning Material:

Ruby From Other Languages
For those who are already familiar with some other programming language, the following article worth a quick reading to give you a glance of this language.

https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/

Beginner
For those who are beginner or want to learn deeper, the following materials are recommended:

The Ruby Programming Language

by David Flanagan, Yukihiro Matsumoto(The creator of Ruby)

Thanks to the safaribooksonline service booked by our company, you can read it for free if you have registered to the program, add the following book to your queue:

https://www.safaribooksonline.com/library/view/the-ruby-programming/9780596516178/

Programming Ruby-The Pragmatic Programmer’s Guide

Available here:http://ruby-doc.com/docs/ProgrammingRuby/

2.Some questions you may need to know
Reading with questions is always a good way to learn things quickly. In order to read the code of the project more easily, I suggest to go through the materials with following questions(go through all the chapters if you have time!):

  • What’s the meaning before variable such as: > $var1, @@var2 and @var3 ?
  • What’s the difference between single-quoted strings and double-quoted strings?
  • How to get the API of specific class?
  • What is block and yield?
  • How to create a new object?
  • What are attr_accessor/attr_reader/attr_writer and why do ruby have these methods?
  • What is the difference between require_relative and require in Ruby?
  • What is the difference between include and require?
  • What is the difference between module and class?
  • Some other knowledges you need to know, iterators, hash, <<

3.Ruby-Style-Guide
I personally find the naming part worth to have a try.

https://github.com/bbatsov/ruby-style-guide#naming

To be short in naming:

  • Use snake_case for directories,files,methods and variables;
  • Use CamelCase for modules, class;
  • Predicate methods (methods that return a boolean value) should end in a question mark
  • Potentially dangerous methods (i.e. methods that modify self or the arguments, exit! (doesn’t run the finalizers like exit does), etc.) should end with an exclamation mark