Excel Icon

RUBY GENERAL BASICS

Links


    //BASICS
    # for comments
    print and puts
    variables not defined (like js/php)


    //METHODS
    def NameMethod
         puts "Hi Mark, this is your method"
    end

    NameMethod #to call it

    #params
    def sayHi(name, age)
        puts ("Hi " + name + ", you are " + age.to_s)
        return true
    end
    sayHi(Mike, 38)


    //CONDITIONAL STATEMENTS
    and or
    if elsif end