num = 3 3.odd? 3.even? 3.next str = "abc" str.length someValue = nil someValue.nil? aaa = "abc" bbb = "abc" aaa == bbb // aaa.equal? bbb // sym1 = :abc sym2 = :abc sym1.equal? sym2 num3 = 1_000_000
flag = true name = if flag "joe" else "other" end def some_method "bla" end
tmp = (1..10) name_hash = { :name => 'joe' } puts name_hash[:name] name_hash2 = { name: "joe" } arr = ["aa", "bb", "cc"] arr2 = %w(aa bb cc) arr = 1..10 arr.each { |item| puts item } arr.map do |item| item * item end arr.map(&:to_s)
By odyss