Check out example codes for "load file in terminal ruby". It will help you in understanding the concepts better.

Code Example 1

launch irb

require './ruby_file.rb'

Learn ReactJs, React Native from akashmittal.com