Class: ConsoleBuddy::Byebug::HelloCommand

Inherits:
Byebug::Command
  • Object
show all
Defined in:
lib/console_buddy/byebug/hello_command.rb

Overview

A demo “hey_buddy” command for Byebug.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject

Short description shown in the ‘help’ output.



20
21
22
23
24
# File 'lib/console_buddy/byebug/hello_command.rb', line 20

def self.description
  <<-EOD
    hello: Prints "Hi, I'm buddy!"
  EOD
end

.regexpObject

Return a regex to match the “hey_buddy” command input.



13
14
15
# File 'lib/console_buddy/byebug/hello_command.rb', line 13

def self.regexp
  /^\s*hey_buddy\s*$/
end

Instance Method Details

#executeObject

Called when the user types ‘hey_buddy` in Byebug.



29
30
31
# File 'lib/console_buddy/byebug/hello_command.rb', line 29

def execute
  puts "Hi, I'm buddy!"
end