use load to load external source code files into your program. : load « Language Basics « Ruby






use load to load external source code files into your program.


//File: string_extensions
class String
  def vowels
    self.scan(/[aeiou]/i)
  end
end

load 'string_extensions'
puts "This is a test".vowels.join('-')

 








Related examples in the same category

1.Test load command