Wiki - README‎ > ‎Programming‎ > ‎

Ruby

Ruby Regular Expressions (link)

A Pragmatic Programmer's Guide (link)
Ruby Tutorials (link)
Method Calls (link)
Class and Instance Variables (link)

array shortcut
a = %w{ ant bee cat dog elk }
a[0] » "ant"
a[3] » "dog"

type signatures for functions (link) (download link)
class Company
  def name
    "Blue Danube"
  end
end
 
class Person
  def name
    "Daniel Spiewak"
  end
end
 
typesig String, Type::Respond(:name)
def output(msg, value)
  puts msg + " " + value.name
end
 
c = Company.new
p = Person.new
 
output("The company name is: ", c)
output("The person is: ", p)
 
output("The programmer is: ", "a genius")    # error

quick syntax (link)

aoeu
Comments