Tag:Ruby syntax

  • Summary of syntax and language features of ruby

    Time:2021-11-22

    Ruby is an interpreted, object-oriented, dynamically typed language. Ruby’s strategy is to find a balance between flexibility and runtime security. With the emergence of rails framework, ruby became a blockbuster around 2006, and also guided people to regain the fun of programming. Although ruby is not very efficient in terms of execution speed, it can […]

  • Ruby Grammar Notes

    Time:2019-6-5

    Accept user input first_name = gets.chomp title case first_name.capitalize! Alphabet capitalized first_name.upcase! Letters are lowercase first_name.downcase! Multiline output print <<EOF # Multi-line output EOF Notes # I am a commentary. Variable acquisition #{first_name} variable Global variables$ Class variables @ @ Method [email protected] Lower-case letters or local variables_ if/else if a < b puts ‘1’ elsif […]