Ruby extension method


Ruby extension class is pretty simple. so i am just going to use a very simple example. Say i am going to extend Ruby's string class to include a method called "hello". Basically what it does is add a "hello" string to any string you might have.

For example,

myString = "'Jeremy"

myString.hello() will get you "Jeremy hello there!". Here is  an example of our code.







Comments

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type