Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Ruby (Rails Girls)

Introduction to Ruby (Rails Girls)

A short introduction to Ruby, created with one of the Rails Girls events in mind.

It tries to cover variables, simple calculations, conditions, functions, collections, symbols and classes.

Lukasz Wrobel

May 25, 2014
Tweet

More Decks by Lukasz Wrobel

Other Decks in Programming

Transcript

  1. About me • Architect, team leader; • high-traffic websites: ◦

    nk.pl; ◦ Gadu-Gadu. • “Memoirs of a Software Team Leader”; • @lukaszwrobel
  2. age = 22 if age > 30 puts "Too old"

    else puts "Acceptable" end
  3. friend = { "name" => "William", "age" => 45, }

    puts friend["name"] # => "William"
  4. friend = { :name => "William", :age => 45, }

    puts friend[:name] # => "William"
  5. class Person def say_hello(name) puts "My name is " +

    name end end somebody = Person.new somebody.say_hello("Emily")
  6. class Person def initialize(name) @name = name end def say_hello

    puts "My name is " + @name end end me = Person.new("Łukasz") me.say_hello # => "My name is Łukasz"