Arrays in Ruby

We can simply define arrays as a list of various values. Let's have a look at an example:

irb(main):005:0> name = ["nipun","metasploit"]
=> ["nipun", "metasploit"]
irb(main):006:0> name[0]
=> "nipun"
irb(main):007:0> name[1]
=> "metasploit"  

Up to this point, we have covered all the required variables and data types that we will need for writing Metasploit modules.

For more information on variables and data types, refer to the following link: https://www.tutorialspoint.com/ruby/index.htm.

Refer to a quick cheat sheet for using Ruby programming effectively at the following link: https://github.com/savini/cheatsheets/raw/master/ruby/RubyCheat.pdf.

Transitioning from another programming language to Ruby? Refer to a helpful guide: http://hyperpolyglot.org/scripting.