Help me to understand ruby

ruby

#1

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?

Thanks,
JEgadeesh


#2

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


#3

Do you know what is the use of option keyword


#4

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