Skip to main content

Posts

Showing posts with the label conditions

The Beginning

Today I covered the remainder of S3 and the introduction of EC2. I read the first pages of ruby under the microscope. I learned what tokenization is and parsing. There is quite some complexity to tokenization and parsing. Ruby is built on top of C. I am picking up the basics From reading the ruby docs, I learnt: - Numbers, strings, Arrays, Hashes are actually called Literals - if, unless, while, until, for, break, next, redo are called Control Expressions.  - Ternary if can be written as ? : input_type = gets =~ /hello/i ? "greeting" : "other" is the equivalent of: input_type =   if gets =~ /hello/i     "greeting"   else     "other"   end - "unless" is the equivalent of "not true - You can put the else condition but the elsie after unless. - case uses the === method. 1)  case "2" when /^1/, "2"   puts "the string starts with one or is '2'" ...