Help me to understand ruby

Hi Team,

I am a beginner in ruby, i have few questions while understanding the existing program. help me to under stand below lines

class ConnectionCheck < Sensu::Plugin::Check::CLI #Help me to understand why they append the sensu module into the class? why they use ‘<’

option :net,
short: ‘-a URL’,
long: ‘–api URL’ .

What does option key word does, what is the benefit of short, long

Shall we use the begin block inside the a method. If yes, That method is will execute first or the begin block alone execute inside the method?


There is no appending going on. It is inheritance. ConnectionCheck is simply a subclass of Sensu::Plugin::Check::CLI

Do you know what is the use of option keyword

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.