Ruby – Blocks
You have seen how Ruby defines methods where you can put number of statements and then you call that method. Similarly, Ruby has a concept of Block. A block consists…
You have seen how Ruby defines methods where you can put number of statements and then you call that method. Similarly, Ruby has a concept of Block. A block consists…
Ruby methods are very similar to functions in any other programming language. Ruby methods are used to bundle one or more repeatable statements into a single unit. Method names should…
You have seen MySQL pattern matching with LIKE ...%. MySQL supports another type of pattern matching operation based on regular expressions and the REGEXP operator. If you are aware of PHP or PERL,…
Loops in Ruby are used to execute the same block of code a specified number of times. This chapter details all the loop statements supported by Ruby. Ruby while Statement…
The max function is used to get the maximum valued item present in a sequence. Syntax max($seq as item()*) Input Parameters $seq − provided sequence. A sequence can contain 0 or more items.…
Properly defining the fields in a table is important to the overall optimization of your database. You should use only the type and size of field you really need to…
Ruby offers conditional structures that are pretty common to modern languages. Here, we will explain all the conditional statements and modifiers available in Ruby. Ruby if...else Statement Syntax if conditional…
Running and Shutting down MySQL Server First check if your MySQL server is running or not. You can use the following command to check it − ps -ef | grep…
Comments are lines of annotation within Ruby code that are ignored at runtime. A single line comment starts with # character and they extend from # to the end of…
Ruby supports a rich set of operators, as you'd expect from a modern language. Most operators are actually method calls. For example, a + b is interpreted as a.+(b), where…